Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML DOM Time object


May 06, 2021 JavaScript with HTML DOM Reference book


Table of contents


HTML DOM Time object


Time object

Time objects are new in HTML5.

The Time object represents an HTML-lt;time-and-gt; element.

Access the Time object

You can use getElementById() to access the elements:

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

Create a Time object

You can use the document.createElement() method to create an element:

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

Time object properties

Attributes describe
dateTime 设置或返回 <time> 元素中 datetime 属性的值。

Standard properties and events

Time objects also support standard properties and events.


Related articles

HTML Reference Manual: HTML slt;time.gt; Tags