<del>

Term side of the Card.
Topic: Semantics
Unit title: <del>
Categories: Tag
Explanation side of the Card

Explanation: The element that is used to represent text that has been removed from a document. It typically renders as strikethrough text, indicating that the content is no longer relevant or has been replaced.

Browser compatibility:
  • The chrome browser supports this feature starting from version 1.
  • The edge browser supports this feature starting from version 12.
  • The firefox browser supports this feature starting from version 1.
  • The safari browser supports this feature starting from version 4.
Availability: 

Example

Wronghtml
<p>
  Price: <del>$40</del> $30
</p>
Righthtml
<p>
  Price: <s>$40</s> $30
</p>

<s> marks content that is no longer accurate, while <del> marks an edit removed from the document.

Common mistakes

  • Using <del> for an old price, which is no longer relevant rather than removed.
  • Relying on the strikethrough alone, which most screen readers do not announce.

Interview questions

What attributes does <del> support?

cite for a URL explaining the change and datetime for when it was made.

Do screen readers announce <del>?

Most do not by default, so add hidden text like 'removed' when the change matters.

Analytics cookiesWe'd like to use analytics cookies to see which pages are useful. They're set only if you accept. Privacy Policy