Change the email address of an email field:
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.
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.
Return the value property:
Set the value property:
Value | Description |
---|---|
text | Specifies a single e-mail address, or a list of e-mail addresses |
Return Value: | A String, or a comma-separated list of strings, representing a valid email address |
---|
Get the email address of an email field:
The result of x will be:
An example that shows the difference between the defaultValue and value property:
HTML reference: HTML <input> value attribute