HTML DOM TimeObject


Time Object

The Time object is new in HTML5.

The Time object represents an HTML <time> element.

Access a Time Object

You can use getElementById() to access a <time> element:

var x = document.getElementById("myTime"); Try it yourself

Create a Time Object

You can use the document.createElement() method to create a <time> element:

var x = document.createElement("TIME"); Try it yourself

Time Object Properties

Property Description
dateTime Sets or returns the value of the datetime attribute of a <time> element.

Standard Properties and Events

The Time object also supports standardpropertiesandevents。


Related Articles

HTML Reference Manual:HTML <time> Tag

Other Extensions