Share
How do I get the value of text input field
Question
Hi,
How do I get the value of an input field using Javascript?
Thanks
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Answer ( 1 )
To get the value of an input field in JavaScript, you can use the value property of the HTMLInputElement object.
Here is an example:
You can also use the value property to set the value of the input field: