
- 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 Time Object
The HTML DOM Time Object in HTML represents the <time> element.
Creating a <time> element
var timeObject = document.createElement(“TIME”)
Here, “timeObject” can have the following properties −
Property | Description |
---|---|
dateTime | Itsets/returns the value of the dateTime attribute of a <time>element |
Let us see an example of Time dateTime property −
Example
<!DOCTYPE html> <html> <head> <title>Time dateTime</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>Time-dateTime</legend> <label>Notification : <strong>Examination Incoming!</strong> <time id="TimeDateTimeSelect" dateTime="2019-05-23T12:45Z"> </label> <input type="button" onclick="getExamDate()" value="What's the Exam Date?"> <div id="divDisplay"></div> </fieldset> </form> <script> var divDisplay = document.getElementById("divDisplay"); var TimeDateTimeSelect = document.getElementById("TimeDateTimeSelect"); function getExamDate() { divDisplay.textContent = 'Examination Date: '+TimeDateTimeSelect.dateTime; } </script> </body> </html>
Output
Before clicking ‘What’s the Exam Date?’ button −
After clicking ‘What’s the Exam Date?’ button −
- Related Articles
- HTML DOM Input Time Object
- HTML DOM HTML Object
- HTML DOM Object Object
- HTML DOM Ins Object
- HTML DOM HR Object
- HTML DOM Variable Object
- HTML DOM aside Object
- HTML DOM Abbreviation Object
- HTML DOM Address Object
- HTML DOM Meter Object
- HTML DOM MouseEvent Object
- HTML DOM Nav Object
- HTML DOM Ol Object
- HTML DOM Title Object
- HTML DOM TouchEvent Object

Advertisements