Get Input Email field - Javascript DOM HTML Element

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():

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

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

<button onclick="myFunction()">get the e-mail address of the email field</button>

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

function myFunction() {/*  ww  w. j a v  a 2 s.  c  om*/
    var x = document.getElementById("myEmail").value;
    document.getElementById("demo").innerHTML = x;

Related Tutorials