HTML DOM Time Object

Time Object

The Time object is a new object in HTML5.

The Time object represents the HTML <time> element.

Accessing Time Object

You can access the <time> element by using getElementById():

var x = document.getElementById("mySource");

Try It Yourself

Creating Time Object

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

var x = document.createElement("SOURCE");

Try It Yourself

Time Object Properties

Properties Description
dateTime Set or return the value of the datetime attribute of the <time> element.

Standard Properties and Events

Time Object Supports StandardsPropertiesAndEvents.

Related Pages

HTML Reference Manual:HTML <time> Tag