Input Email defaultValueProperty
Example
Change the default value of the email field:
Try it yourself »
Definition and Usage
The defaultValue property sets or returns the default value of the email field.
Note:The default value describes the HTMLvalueattribute's value.
defaultValue andvalueThe difference between the properties is that defaultValue contains the default value, while value contains the modified value. If not modified, defaultValue and value are the same (see "More Examples").
The defaultValue property is very useful when you want to check whether the email field value has changed.
Browser Support
![]()
All major browsers support this defaultValue property.
Note:Internet Explorer 9 and earlier IE versions, and Safari browser do not support the <input type="email"> element.
Syntax
Return the defaultValue property:
Set the defaultValue property:
Property Values
| Value | Description |
|---|---|
| value | Specifies the default value of the email field |
Technical Details
| Return value: | A string, representing the default value of the email field |
|---|
More Examples
Example
Get the default value of the email field:
xThe output result is:
Try it yourself »
Example
This example demonstrates the difference between the defaultValue and value properties:
var defaultVal = x.defaultValue;
var currentVal = x.value;
Try it yourself »
Other Extensions
Input Email Object