
- 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 name Property
The HTML DOM Input Email name property returns a, which is the value of the name attribute of input Email. User can also set it to a new string.
Syntax
Following is the syntax −
- Returning string value
inputEmailObject.name
- Setting name attribute to a string value
inputEmailObject.name = ‘String’
Example
Let us see an example of Input Email name property −
<!DOCTYPE html> <html> <head> <title>Input Email name</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-name</legend> <label for="EmailSelect">Employee Email: <input type="email" id="EmailSelect" value="x.agent@secret.com" name="Shasha-Miller"> </label> <input type="button" onclick="getName()" value="Who's Email ID is this? "> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var inputEmail = document.getElementById("EmailSelect"); function getName() { if(inputEmail.value === 'x.agent@secret.com') divDisplay.textContent = 'Above Email belongs to '+inputEmail.name; else divDisplay.textContent = 'Above Email belongs to no one!'; } </script> </body> </html>
Output
This will produce the following output −
Before clicking ‘Who’s Email ID is this?’ button −
After clicking ‘Who’s Email ID is this?’ button −
- Related Articles
- HTML DOM Input Email autocomplete Property
- HTML DOM Input Email autofocus Property
- HTML DOM Input Email defaultValue 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
- HTML DOM Input Email pattern Property
- HTML DOM Input Email placeholder Property
- HTML DOM Input Email readOnly Property
- HTML DOM Input Email required Property
- HTML DOM Input Email size Property
- HTML DOM Input Email type Property
- HTML DOM Input Email value Property
- HTML DOM Input Button name Property

Advertisements