HTML DOM Time 對象

2023-04-11 11:08 更新

Time 對象是 HTML5 中新增的。

Time 對象表示一個 HTML <time> 元素。

訪問 Time 對象

您可以使用 getElementById() 來訪問 <time> 元素:

var x = document.getElementById("myTime");嘗試一下

創(chuàng)建 Time 對象

您可以使用 document.createElement() 方法來創(chuàng)建 <time> 元素:

var x = document.createElement("TIME");嘗試一下

Time 對象屬性

屬性 描述
dateTime 設(shè)置或返回 <time> 元素中 datetime 屬性的值。

標準屬性和事件

Time 對象同樣支持標準 屬性事件。


相關(guān)文章

HTML 參考手冊:HTML <time> 標簽

以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號