Javascript examples for DOM HTML Element:Input Email field
The type property returns the type of form email element.
For an input type="email", this property always returns "email".
A String, representing the type of form element the email field is
The following code shows how to return which type of form element the email field is:
<!DOCTYPE html> <html> <body> E-mail: <input type="email" id="myEmail"> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w . ja va2s. com var x = document.getElementById("myEmail").type; document.getElementById("demo").innerHTML = x; } </script> </body> </html>