totn HTML

HTML: <del> tag

This HTML tutorial explains how to use the HTML element called the <del> tag with syntax and examples.

Description

The HTML <del> tag is used to markup text that has been deleted from a document but retained to show the history of changes to a document. Browsers traditionally render the text found within the <del> tag as text with a strikethrough. You can use the companion tag called the <ins> tag to markup new text that has been inserted into a document. This tag is also commonly referred to as the <del> element.

Syntax

In HTML, the syntax for the <del> tag is:

<body>
<p><del cite="https://www.techonthenet.com">This text has been deleted</del> but this text has not.</p>
</body>

Sample Output


Attributes

In addition to the Global Attributes, the following is a list of attributes that are specific to the <del> tag:

Attribute Description HTML Compatibility
cite URL for the source that explains why the text was deleted from the document HTML 4.01, HTML5
datetime Date and time that the text was deleted from the document HTML 4.01, HTML5

Note

  • The HTML <del> element is found within the <body> tag.
  • The <del> tag is traditionally used to track changes to a document and highlight removals from the document. The <del> tag can also be used in diff tools to show source code removals.
  • See also the <s> tag and the <strike> tag.

Browser Compatibility

The <del> tag has basic support with the following browsers:

  • Chrome
  • Android
  • Firefox (Gecko)
  • Firefox Mobile (Gecko)
  • Internet Explorer (IE)
  • Edge Mobile
  • Opera
  • Opera Mobile
  • Safari (WebKit)
  • Safari Mobile

Example

We will discuss the <del> tag below, exploring examples of how to use the <del> tag in HTML5, HTML 4.01 Transitional, XHTML 1.0 Transitional, XHTML 1.0 Strict, and XHTML 1.1.