
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
HTML DOM Input Email defaultValue Property
The HTML DOM Input Email defaultValue property sets/returns the default value corresponding to Email Input. The value attribute changes as the user types in the email input but default value does not change.
Syntax
Following is the syntax −
- Returning string value
inputEmailObject.defaultValue
- Setting defaultValue to string
inputEmailObject.defaultValue = ‘string’
Example
Let us see an example of Input Email defaultValue property −
<!DOCTYPE html> <html> <head> <title>Input Email defaultValue</title> <style> form { width:70%; margin: 0 auto; text-align: center; } * { padding: 2px; margin:5px; } input[type="button"] { border-radius: 10px; } </style> </head> <body> <form> <fieldset> <legend>Email-defaultValue</legend> <label for="EmailSelect">User Email : <input type="email" id="EmailSelect" value="xyz@abc.com"> </label> <input type="button" onclick="getDefaultValue()" value="Reset Default Value"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var inputEmail = document.getElementById("EmailSelect"); divDisplay.textContent = 'defaultValue: '+inputEmail.defaultValue; function getDefaultValue() { var currentValue = inputEmail.value; divDisplay.textContent = 'Value - '+inputEmail.value+' resets to - '+inputEmail.defaultValue; inputEmail.value = inputEmail.defaultValue; } </script> </body> </html>
Output
This will produce the following output −
Before clicking ‘Reset Default Value’ button −
Changing Email Input −
After clicking ‘Reset Default Value’ button −
- Related Articles
- HTML DOM Input URL defaultValue Property
- HTML DOM Input Week defaultValue Property
- HTML DOM Input Password defaultValue Property
- HTML DOM Input Search defaultValue Property
- HTML DOM Input Text defaultValue Property
- HTML DOM Input Month defaultValue Property
- HTML DOM Input Number defaultValue Property
- HTML DOM Input Color defaultValue Property
- HTML DOM Input Time defaultValue Property
- HTML DOM Input Email autocomplete Property
- HTML DOM Input Email autofocus Property
- HTML DOM Input Email disabled Property
- HTML DOM Input Email form Property
- HTML DOM Input Email maxLength Property
- HTML DOM Input Email multiple Property

Advertisements