+ 1
How can I connect Javascript Variables with an HTML input?
Hey Guys, another question from me. I want to know how I can make a JavaScript variable with an HTML input. Just like a code like: var password = prompt("Enter Password") If you don't know what I mean leave a comment and I will describe it in more detail. https://code.sololearn.com/Wc86SPnBGn19/?ref=app
1 Resposta
0
You mean you want to fetch value from input field of HTML ?
For example if we have input like:
<input type="text">
And you need the value entered inside that text field to manipulate with Java Script ?
If yes for that you have to select relate input and can use JS property .value to get value:)
For example given above you can do something like
const text = document.querySelector('input').value;
But for that you must know javascript DOM :)
Try to play with this and check reference from W3Schools:
https://www.w3schools.com/jsref/prop_text_value.asp