Input Time valueProperty

Input Time 对象参考手册Input Time Object

Example

Set the time of the time field:

document.getElementById("myTime").value = "22:53:05";

Try it Yourself »

Definition and Usage

The value property is used to set or return the value of the value attribute of the time field.

The value property describes the time value of the time field.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the value attribute.

Note:Internet Explorer or Firefox browsers do not support HTML <input> elements with the type="time" attribute.


Syntax

Return the value attribute:

timeObject.value

Set the value attribute:

timeObject.value=hh:mm:ss.ms

Property Value

Value Description
hh:mm:ss.ms Describes the time of the time field.

Parsing:
  • hh - hours (e.g., 22 is 10 PM)
  • mm - minutes (e.g., 30)
  • ss - seconds (e.g., 03)
  • ms - milliseconds (e.g., 20)
Examples: "09:55:32.55" or "22:15:35".

Technical Details

Return Value: String, representing the time of the time field (without timezone information).


More Examples

Example

Get the time of the time field:

var x = document.getElementById("myTime").value;
xThe output result is:
16:32:55

Try it Yourself »


Related Pages

HTML Reference Manual:HTML <input> value attribute


Input Time 对象参考手册Input Time Object Other Extensions