HTMLDOM時間オブジェクト
時間オブジェクト
Timeオブジェクトは、HTMLの<time>要素を表します。
時間オブジェクトにアクセスする
getElementById()を使用して、<time>要素にアクセスできます。
例
var x = document.getElementById("myTime");
時間オブジェクトを作成する
document.createElement()メソッドを使用して、<time>要素を作成できます。
例
var x = document.createElement("TIME");
時間オブジェクトのプロパティ
Property | Description |
---|---|
dateTime | Sets or returns the value of the datetime attribute in a <time> element |
標準のプロパティとイベント
Timeオブジェクトは、標準のプロパティとイベントもサポートしています。
関連ページ
HTMLリファレンス:HTML <time>タグ