The proper usage of the HTML5 <del> tag is to indicate the deletion of text from a document. When this tag appears, it means that omission and changes were done.
The HTML5 <del> tag is often utilized along with the HTML5 <ins> tag, particularly when a new text is placed to substitute the one that was deleted. Using these two tags is a great way to indicate and keep track of corrections and changes that were made in a document.
Here is an example of how the HTML5 <del> tag is used along with the HTML5 <ins> tag: <p>I am going to the <del>cafe</del> <ins>restaurant</ins>!</p>
Almost all major browsers are capable of supporting the use of HTML5 <del> tag. The list of browsers includes Internet Explorer, Firefox, Opera, Google Chrome and Safari. When the HTML5 <del> tag is used, these browsers will place a strikethrough on the deleted text and then underline the inserted one.
The <del> tag is used similarly for both the HTML4.01 and HTML5. It is capable of supporting both the Global Attributes and Events Attributes in HTML5.
The attributes for the <del> tag are the following:
|
Attribute
|
Value
|
Description
|
|
cite
|
URL
|
Specifies a URL to
a document that explains the reason why the text was deleted
|
|
datetime
|
YYYY-MM-DDThh:mm:ssTZD
|
Specifies the date
and time of when the text was deleted
|