
- 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 Time type Property
The HTML DOM Input Time type property returns/sets type of Input Time.
Syntax
Following is the syntax −
- Returning string value
inputTimeObject.type
- Setting type to string value
inputTimeObject.type = stringValue
String Values
Here, “stringValue” can be the following −
stringValue | Details |
---|---|
time | It defines that input type is time |
datetime-local | It defines that input type is datetime-local |
checkbox | It defines that input type is checkbox |
text | It defines that input type is text |
Example
Let us see an example of Input Time type property −
<!DOCTYPE html> <html> <head> <title>Input Time type</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-type</legend> <label for="TimeSelect"></label> <input type="time" id="TimeSelect"> <input type="button" onclick="getTypeOfInput()" value="What input is expected?"> <div id="divDisplay"></div> </fieldset> </form> <script> var labelDisplay = document.querySelector("label"); var divDisplay = document.getElementById("divDisplay"); var inputTime = document.getElementById("TimeSelect"); function getTypeOfInput() { labelDisplay.textContent = 'Time: '; divDisplay.textContent = 'Input of type time (hh:mm:ss.ms) is expected'; } </script> </body> </html>
Output
This will produce the following output −
Before clicking ‘What input is expected?’ button −
After clicking ‘What input is expected?’ button −
- Related Articles
- HTML DOM Input URL type Property
- HTML DOM Input Week type Property
- HTML DOM Input Number type Property
- HTML DOM Input Reset type property
- HTML DOM Input Search type property
- HTML DOM Input Submit type Property
- HTML DOM Input Password type property
- HTML DOM Input Radio type property
- HTML DOM Input Range type property
- HTML DOM Input Button type Property
- HTML DOM Input FileUpload type Property
- HTML DOM Input Hidden type Property
- HTML DOM Input Month type Property
- HTML DOM Input Checkbox type Property
- HTML DOM Input Color type Property

Advertisements