HTML datetime 屬性
<ins> 元素的 datetime 屬性用於指定顯示插入文字時的日期和時間。
以下是語法 -
<ins datetime="YYYY-MM-DDThh:mm:ssTZD">
上面 datatime 屬性顯示插入文字時的日期和時間,格式如下:-
- YYYY - 年份
- MM - 月份
- DD - 當月日期
- hh - 小時
- mm - 分鐘
- ss - 秒
- TZD - 時區設計器
我們現在將透過一個示例瞭解如何實現 <ins> 元素的 datetime 屬性 -
示例
<!DOCTYPE html> <html> <body> <h1>Demo Heading</h1> <ins cite = "new.htm" datetime = "2019-05-11T18:30:03Z">Text is inserted.</ins> </body> </html>
輸出
在上面的示例中,我們使用 <ins> 元素插入了一段文字 -
<ins cite = "new.htm" datetime = "2019-05-11T18:30:03Z"> Text is inserted. </ins>
上面,我們使用 cite 屬性設定了插入的原因 -
cite="new.htm
另外,我們使用 datetime 屬性設定了插入日期 -
datetime = "2019-05-11T18:30:03Z
廣告