X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR BOOTSTRAP XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Input Time value Property

Input Time Object Reference Input Time Object

Example

Set a time for a time field:

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

Try it yourself »


Definition and Usage

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.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The value property is supported in all major browsers.

Note: The <input type="time"> element is not supported in Internet Explorer or Firefox.


Syntax

Return the value property:

timeObject.value

Set the value property:

timeObject.value=hh:mm:ss.ms

Property Values

Value Description
hh:mm:ss.ms Specifies a time for the time field.

Explanation of components:
  • hh - hour (e.g. 22 for 10.00pm)
  • mm - minutes (e.g. 30)
  • ss - seconds (e.g. 03)
  • ms - milliseconds (e.g 20)
Examples: "09:55:32.55", "22:15:35" or "16:00".

Technical Details

Return Value: A String, representing the time (with no timezone information) of the time field


More Examples

Example

Get the time of a time field:

var x = document.getElementById("myTime").value;

The result of x will be:

16:32:55

Try it yourself »


Related Pages

HTML reference: HTML <input> value attribute


Input Time Object Reference Input Time Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook