Table of Contents
INTRODUCTION
The <del> element is used to indicate that text has been deleted from the webpage. It is shown by browser with a strike-through line on the text. This tag makes possible to show difference/changes made in text or track changes in source code. The tag also helps screen readers and search engine understand that the content has been deleted.
The <del> element is generally used with <ins> element to show the text that is newly added.
Syntax:
<del>--text--</del>
Example:
<p>
<del> This is deleted text. </del>
I am new text.
</p>
Output:
This is deleted text.
I am new text
Tag Omission
The HTML <del> element must have both start tag and end tag.
ATTRIBUTES
1. cite
cite attributes is used for URI of resource that explains the change. (Example: A link to webpage)
Example:
<p> <del cite="www.example.com/blog"> Outdated clause </del>
new clause.
</p>
2. datetime
datetime attributes is used to specify date and time of change. It must be a valid date string while time is optional. The Date string format is - YYYY-MM-DD and date-time string format is YYYY-MM-DDTHH:MM:SSZ
Example:
<p> <del datetime="2023-07-05T15:17:03Z"> Old policy text here. </del>
New policy text.
</p>