how do you take an input from the user and use it as pop-up text in html using javascript?
i tried using html input tags but it didn’t give me what i expected. I don’t know how to take the user input from the input tag and use the same input in javascript
2
Answers
If you want to update something as the user is typing, you can add a listener for the
input
event on the<input>
element, like below.If you just want to get the value in the middle of some other function, you can access the
.value
property of the<input>
element, like below.