HTML DOM Input Time Object
Input Time Object
The Input Time object is new in HTML5.
The Input Time object represents an HTML element using the type="time" attribute .
Note: Internet Explorer or Firefox browsers do not support the HTML using the type="time" attribute .
Accessing the Input Time Object
You can use the getElementById() function to access the one using the type="time" attribute element:
var x = document.getElementById("myTime");
Try it
Tip: You can also access the Input Color object through a form'sElementcollection to access the Input Time object.
Creating the Input Time Object
You can use the document.createElement() method to create the one using the type="time" attribute element:
var x = document.createElement("INPUT");
x.setAttribute("type", "time");
Try it
Input Time Object Properties
| property | Description |
|---|---|
| autocomplete | Sets or returns the value of the autocomplete attribute of the time field |
| autofocus | Sets or returns whether the time field automatically gets focus after the page loads |
| defaultValue | Sets or returns the default value of the time field |
| disabled | Sets or returns whether the time field is available |
| form | Returns a reference to the form that uses the time field |
| list | Returns a reference to the datalist containing the time field |
| max | Sets or returns the value of the max attribute of the time field |
| min | Sets or returns the value of the min attribute of the time field |
| name | Sets or returns the value of the name attribute of the time field |
| readOnly | Sets or returns whether the time field is read-only |
| required | Sets or returns whether the time field is a required field in the form |
| step | Sets or returns the value of the step attribute of the time field |
| type | Returns the form element type of the time field |
| value | Sets or returns the value of the value attribute of the time field |
Standard properties and events
The Input Time object also supports the standard property and Events.
Related Articles
HTML Tutorial: HTML Forms
HTML Reference Manual: HTML tag
HTML Reference Manual: HTML type Attribute