
- 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 Date name Property
The HTML DOM Input Date name property returns a string, which is the name attribute of input date. User can also set it to a new string.
Syntax
Following is the syntax −
- Returning string value
inputDateObject.name
- Setting name attribute to a string value
inputDateObject.name = ‘String’
Example
Let us see an example of Input Date name property −
<!DOCTYPE html> <html> <head> <title>Input Date Name</title> </head> <body> <form> Date Select: <input type="date" id="date" name="Monday"> </form> <button onclick="changeNameValue()">Change name value</button> <div id="divDisplay"></div> <script> var inputDate = document.getElementById("date"); var divDisplay = document.getElementById("divDisplay"); divDisplay.textContent = 'Name of date input: '+inputDate.name; function changeNameValue() { if(inputDate.name == 'Monday'){ inputDate.name = 'Tuesday'; divDisplay.textContent = 'Name of date input: '+inputDate.name; } } </script> </body> </html>
Output
This will produce the following output −
Before clicking ‘Change name value’ button −
After clicking ‘Change Name Value’ button −
- Related Articles
- HTML DOM Input Date autofocus Property
- HTML DOM Input Date disabled Property
- HTML DOM Input Date form Property
- HTML DOM Input Date max Property
- HTML DOM Input Date min Property
- HTML DOM Input Date readOnly Property
- HTML DOM Input Date required Property
- HTML DOM Input Date step Property
- HTML DOM Input Date type Property
- HTML DOM Input Date value Property
- HTML DOM Input Button name Property
- HTML DOM Input FileUpload name Property
- HTML DOM Input Hidden name Property
- HTML DOM Input Month name Property
- HTML DOM Input Number name Property

Advertisements