HTML DOM Input Email defaultValue property
Examples
Modify the default value of the email field:
try it"
Definitions and use
defaultValue property sets or returns the default value for the email field.
Note: The default value describes the HTML value The value of the property.
defaultValue and value difference is that the defaultValue attribute contains the default value, value contains the modified value. If you do not modify defaultValue and value are the same (See "More Examples").
defaultValue attribute when you want to see if the email field value changes are very useful.
Browser Support
All major browsers are the defaultValue property.
Note: Internet Explorer 9 and earlier versions of IE, Safari browser does not support <input type = "email"> element.
grammar
Back defaultValue attributes:
Setting defaultValue property:
Property Value
value | description |
---|---|
value | It specifies the default value of the email field |
technical details
return value: | String representing the default value of the email field |
---|
More examples
Examples
Gets the default value of the email field:
x The output is:
try it"
Examples
This example demonstrates the difference between value and defaultValue attributes:
var defaultVal = x.defaultValue;
var currentVal = x.value;
try it"