How would I go about making a simple HTML page that a user can type in whatever they want in a text input, and that be sent to my console log or or whatever you call it using JavaScript?
Ok, assuming I can decipher this question correctly, what you're asking is for a webpage that when you input something in the text input, it will console.log it to the browsers console? First things first, lets put up an input on the page. This can be done rather easily: ```html <!DOCTYPE html> <html> <head></head> <body> <input> </body> </html> ``` Now then, input's have a parameter you can give them called "onchange", so when the input field changes it will execute some javascript. You can then in that have a console.log in there. It would look something like this: ```js console.log(this.value); ``` this represents the current element, and value is basically saying the value of the current element. You can read more about these APIs here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onchange https://developer.mozilla.org/en-US/docs/Web/API/console/log Now then, say you wanted a button that when pressed reads the value of the input. To do this we would first need to create a button and assign an ID to the input so the input can be fetched with JavaScript easily. Let's see what that looks like: ```html <!DOCTYPE html> <html> <head></head> <body> <input id="input"> <button>button</button> </body> </html> ``` Now first you would assign the parameter "onclick" to the button, this time the value of console.log would need to find the value of the input. To do that let's first select the element with `document.getElementById`, then once we have the element, similar to last time we can use .value to get the value of the element. You can find more about the above APIs here: https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onclick https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementById https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button With this said, now I want you to complete this code as a little exercise using what I've showed here and in your previous questions.
For those who see this in the future, you can view the previous information from his questions on this post: https://questioncove.com/study#/updates/6272b9eb52d51487f1e9c400
Join our real-time social learning platform and learn together with your friends!