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

HTML <del> Tag


แท็ก <del> ใน HTML ใช้แสดงข้อความที่ลบ ซึ่งจะทำให้ข้อความนั้นมีเส้นทับ

แอตทริบิวต์ของ <del> tag:

  • cite — URL ที่บอกว่าทำไมข้อความถึงถูกลบ
  • datetime — วันที่และเวลาที่ข้อความถูกลบ

มาดูตัวอย่างการใช้ <del> element ใน HTML:

ตัวอย่าง

<!DOCTYPE html>
<html>
<body>
<h2>Player Details with Reporting Time</h2>
<p>These are the <ins>details with reporting time</ins></p>
<form>
  <fieldset>
    <legend>New Details -</legend>
    Player - <input type="text"><br>
    Rank - <input type="number"><br>
    Email - <input type="email"><br>
    Reporting Time - <input type="time">
  </fieldset>
</form>
<p><del>All data captured before the World Cup.</del></p>
</body>
</html>

ผลลัพธ์แสดงข้อความมีเส้นทับ เนื่องจากเราลบบรรทัดนั้นทั้งหมด:

HTML <del> Tag

ในตัวอย่างข้างต้น เราลบข้อความด้วย <del> elements:

<del> All data captured before the World Cup. </del>

ตอนนี้คุณเห็นข้อความที่มีเส้นทับ