Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> HTML

HTML <ins> datetime Attribute


แอตทริบิวต์ datetime ขององค์ประกอบ <ins> ใช้ระบุวันที่และเวลาที่ข้อความถูกแทรก

Syntax ดังนี้:

<ins datetime="YYYY-MM-DDThh:mm:ssTZD">

ด้านบน แอตทริบิวต์ datetime แสดงวันที่เวลาที่ข้อความถูกแทรกในรูปแบบ:

  • YYYY - ปี
  • MM - เดือน
  • DD - วันของเดือน
  • hh - ชั่วโมง
  • mm - นาที
  • ss - วินาที
  • TZD - Time Zone Designator

มาดูตัวอย่างการใช้ datetime attribute ของ <ins> element:

ตัวอย่าง

<!DOCTYPE html>
<html>
<body>
  <h1>Demo Heading</h1>
  <ins cite="new.htm" datetime="2019-05-11T18:30:03Z">Text is inserted.</ins>
</body>
</html>

ผลลัพธ์

HTML <ins> datetime Attribute

ในตัวอย่างข้างต้น เราแทรกข้อความด้วย <ins> element:

<ins cite="new.htm" datetime="2019-05-11T18:30:03Z">Text is inserted.</ins>

ด้านบน เราตั้งเหตุผลการแทรกด้วย cite attribute:

cite="new.htm

พร้อมกับนั้น เราตั้งวันที่แทรกด้วย datetime attribute:

datetime="2019-05-11T18:30:03Z