Javascript examples for DOM HTML Element:Input Email field
The Input Email object represents an HTML <input> element with type="email".
You can access an <input> element with type="email" by using getElementById():
<!DOCTYPE html> <html> <body> E-mail: <input type="email" id="myEmail" value="john@example.com"> <button onclick="myFunction()">get the e-mail address of the email field</button> <p id="demo"></p> <script> function myFunction() {/* ww w. j a v a 2 s. c om*/ var x = document.getElementById("myEmail").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>