Skip to content

18. del s ins Elements

The <del>, <s>, and <ins> elements are used to mark changes in documents. <del> marks deleted content, <ins> marks inserted content, and <s> marks content that is no longer accurate. These elements help track document revisions and show edit history.

Marks deleted content:

<p>This is <del>deleted text</del> remaining text.</p>
<del datetime="2024-01-15" cite="https://example.com/revision">
Deleted content
</del>

Marks inserted content:

<p>This is <ins>newly inserted text</ins>.</p>
<ins datetime="2024-01-16" cite="https://example.com/revision">
New content
</ins>

Marks strikethrough text (no longer accurate):

<p>Price: <s>$100</s> $80</p>

Show edits with both deletion and insertion:

<p>
Original: <del>old text</del>
Updated: <ins>new text</ins>
</p>

Browsers typically render:

  • <del>: Strikethrough text
  • <ins>: Underlined text
  • <s>: Strikethrough text
<!-- Good: Semantic deletion -->
<p><del>Removed content</del></p>
<!-- Avoid: Using s for deletions -->
<p><s>Removed content</s></p>
<!-- Good: Semantic insertion -->
<p>Content <ins>new addition</ins>.</p>