X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Input Email value Property

Input Email Object Reference Input Email Object

Example

Change the email address of an email field:

document.getElementById("myEmail").value = "steve@w3schools.com";

Try it yourself »


Definition and Usage

The value property sets or returns the value of the value attribute of an email field.

The value attribute specifies the default value OR the value a user types in (or a value set by a script).

The value can be a single e-mail address, or a list of e-mail addresses.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The value property is supported in all major browsers.

Note: The <input type="email"> element is not supported in Internet Explorer 9 and earlier versions, or in Safari.


Syntax

Return the value property:

emailObject.value

Set the value property:

emailObject.value=text

Property Values

Value Description
text Specifies a single e-mail address, or a list of e-mail addresses

Technical Details

Return Value: A String, or a comma-separated list of strings, representing a valid email address


More Examples

Example

Get the email address of an email field:

var x = document.getElementById("myEmail").value;

The result of x will be:

johndoe@example.com

Try it yourself »


Related Pages

HTML reference: HTML <input> value attribute


Input Email Object Reference Input Email Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook