Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Email value property

Input Email value property

Input Email Object Reference Input Email Object

Example

Modify the email address of the email field:

document.getElementById("myEmail").value = "steve@w3cschool.cc";

Try it »


Definition and Usage

The value property is used to set or return the value of the email field.

The value property describes the default value.

The value can be a simple address, or a list of email addresses.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the value attribute.

Note: Internet Explorer 9 (and earlier IE versions) or Safari browser does not support the HTML element with type="email". .


Syntax

Return the value attribute:

emailObject

.value

Set the value attribute:

emailObject

.value=

text

Attribute values

Value Description
text Specify an email address, or a list of email addresses

Technical Details

Return Value: String, the email list is separated by commas.

More examples

Example

Get the email address of the email field:

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

x

The output is:

johndoe@example.com

Try it »


Related pages

HTML Reference Documentation: HTML value attribute


Input Email Object Reference Input Email Object