Javascript examples for DOM HTML Element:Input Text
Input Text value Property - Get the value of a text field:
<!DOCTYPE html> <html> <body> Name: <input type="text" id="myText" value="Mickey"> <button onclick="myFunction()">Test</button> <script> function myFunction() {/*from w ww . j a v a 2 s. c o m*/ var v = document.getElementById("myText").value; console.log(v); } </script> </body> </html>