Set a time for a time field:
The value property sets or returns the value of the value attribute of a time field.
The value attribute specifies a time for the time field.
The value property is supported in all major browsers.
Note: The <input type="time"> element is not supported in Internet Explorer or Firefox.
Return the value property:
Set the value property:
Value | Description |
---|---|
hh:mm:ss.ms |
Specifies a time for the time field. Explanation of components:
|
Return Value: | A String, representing the time (with no timezone information) of the time field |
---|
Get the time of a time field:
The result of x will be:
An example that shows the difference between the defaultValue and value property:
HTML reference: HTML <input> value attribute