
- 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 DatetimeLocal name Property
The HTML DOM Input DatetimeLocal name property returns a string, which is the value of the name attribute of input datetimeLocal. User can also set it to a new string.
Syntax
Following is the syntax −
- Returning string value
inputDatetimeLocalObject.name
- Setting name attribute to a string value
inputDatetimeLocalObject.name = ‘String’
Example
Let us see an example of Input DatetimeLocal name property −
<!DOCTYPE html> <html> <head> <title>Input DatetimeLocal 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>Datetime-Local-name</legend> <label for="datetimeLocalSelect">Today : <input type="datetime-local" id="datetimeLocalSelect" value="2019-05-23T12:45" name="Rupenzel"> </label> <input type="button" onclick="getnameimum()" value="Who's DOB is this? "> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var inputDatetimeLocal = document.getElementById("datetimeLocalSelect"); function getnameimum() { if(inputDatetimeLocal.value === '2019-05-23T12:45') divDisplay.textContent = 'Above DOB is of '+inputDatetimeLocal.name; else divDisplay.textContent = 'Above DOB is of no one!'; } </script> </body> </html>
This will produce the following output −
Output
Before clicking ‘Who’s DOB is this?’ button −
After clicking ‘Who’s DOB is this?’ button −
- Related Articles
- HTML DOM Input DatetimeLocal disabled Property
- HTML DOM Input DatetimeLocal form Property
- HTML DOM Input DatetimeLocal max Property
- HTML DOM Input DatetimeLocal min Property
- HTML DOM Input DatetimeLocal readOnly Property
- HTML DOM Input DatetimeLocal required Property
- HTML DOM Input DatetimeLocal step Property
- HTML DOM Input DatetimeLocal type Property
- HTML DOM Input DatetimeLocal value Property
- HTML DOM Input DatetimeLocal Object
- HTML DOM Input DatetimeLocal stepDown( ) Method
- HTML DOM Input DatetimeLocal stepUp( ) Method
- HTML DOM Input Button name Property
- HTML DOM Input FileUpload name Property
- HTML DOM Input Hidden name Property

Advertisements