Input Email type Property - Javascript DOM HTML Element

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".

Return Value

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:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

E-mail: <input type="email" id="myEmail">

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {//from   w w  w .  ja  va2s.  com
    var x = document.getElementById("myEmail").type;
    document.getElementById("demo").innerHTML = x;

Related Tutorials