Javascript examples for DOM HTML Element:Form Event
Reading inputs and printing variables
<html> <head> <script> function myFunction()/*from w ww. jav a 2 s . c om*/ { var x=document.getElementById("myEmail").value; console.log(x); } </script> </head> <body> <form> <p> Input your email </p> <input name="myEmail" id="myEmail" type="text"> </form> <button type="button" onclick="myFunction()">Submit Email</button> </body> </html>