HTML <del> Tag

Beginner
5 min read
Updated: Oct 2026
4 examples
Live preview

Definition and Usage

The <del> element marks text that has been deleted from a document — useful for “track changes,” diffs, or showing an old price next to a new one.

Browsers often draw a line through the text. Pair it with <ins> for additions. Optional cite and datetime record why and when the change happened.

Baseline · Widely available.

Not deprecated. Stable across browsers since about July 2015 (and much earlier in practice).

Obsolete: <strike>.

Do not use <strike>. For editorial deletions use <del>; for outdated-but-not-edited content see <s>.

Still visible.

<del> does not hide text from the page or from View Source. Never use it to “hide” secrets.

HTML Syntax

syntax.html
<del> deleted text</del>

Both start and end tags are required. Content is transparent (it can wrap phrasing or, in valid contexts, larger blocks such as a paragraph). The implicit ARIA role is deletion.

Attributes

Attributes specific to <del> (plus globals):

AttributeDescriptionTry it
citeURL of a document that explains the change (e.g. meeting notes)Try it
datetimeMachine-readable date or date-time of the deletionTry it

Global Attributes

The <del> tag also supports the Global Attributes in HTML.

Live Preview

Choose a revision snippet. Deleted parts use <del>; replacements use <ins>.

Real <del> (and <ins>) markup in the sentence below.

Revision

Was $29 $19 this week.

del marks the old price; ins marks the new one

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Mark Deleted Text

Wrap the removed wording in <del>.

HTML
<p>
  <del>This text has been deleted</del>,
  here is the rest of the paragraph.
</p>
Try It Yourself

How It Works

  1. Open <del> before the removed text.
  2. Put the old wording inside the element.
  3. Close with </del>. Both tags are required.
  4. Render. Most browsers show a strikethrough by default.

Example 2 — Track Changes with <ins>

Show what was removed and what replaced it.

HTML
<p>
  There is
  <del>nothing</del>
  <ins>no code</ins>
  either good or bad.
</p>
Try It Yourself

How It Works

  1. Mark the old phrase with <del>.
  2. Mark the new phrase with <ins>.
  3. Keep reading order natural so the sentence still makes sense.
  4. Optional styling can tint del/ins for clearer diffs — semantics come from the tags.

Example 3 — cite and datetime

Record when the change happened and link to an explanation.

HTML
<p>
  Price was
  <del
    cite="https://www.example.com/changelog"
    datetime="2026-10-01"
  >$29</del>
  <ins datetime="2026-10-01">$19</ins>.
</p>
Try It Yourself

How It Works

  1. Set datetime to a valid date (or date-time) string.
  2. Set cite to a URL that explains the edit.
  3. Keep human text clear inside <del> / <ins>.
  4. Do not expect a tooltip by default — these attributes are metadata.

Example 4 — <del> vs <s>

Use <del> for edits; use <s> when content is outdated but not documenting a deletion.

HTML
<!-- Editorial deletion / revision -->
<p>Was <del>$29</del> <ins>$19</ins>.</p>

<!-- No longer accurate (not an edit trail) -->
<p>Today’s special: <s>Sold out yesterday</s> back in stock.</p>
Try It Yourself

How It Works

  1. Choose by meaning. Documented removal → <del>.
  2. Outdated content without an edit history → <s>.
  3. Both may look similar (strikethrough) — semantics differ.
  4. Avoid <strike> — it is obsolete.

Edge Cases & Pitfalls

Most mistakes treat strikethrough as decoration or confuse del with s / strike.

semantics

Not decorative strikethrough

If you only want a line through text for design, use CSS. Use <del> when the text was removed from the document.

vs s

del ≠ s

<s> marks inaccurate or irrelevant content. <del> marks an editorial deletion.

privacy

Text remains in the page

Deleted content is still in the HTML. Do not use <del> to hide secrets or PII.

attrs

Valid datetime

If datetime cannot be parsed, the element has no associated timestamp. Prefer ISO-like dates such as 2026-10-01.

a11y

Meaning beyond the line

Some users may not perceive strikethrough clearly. Pair with clear wording (and <ins> when showing replacements).

Browser Support

The <del> element is core HTML in every browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<del>

Widely available since about July 2015 (and long before). Chrome, Firefox, Safari, Edge, and Opera all support del, cite, and datetime.

98% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer All
Supported
<del> Widely supported

Bottom line: Safe everywhere for marking deletions. Prefer del + ins for revisions; avoid obsolete strike.

Key Takeaways

  • Role: <del> marks text removed from the document.
  • Pair: use <ins> for the replacement text.
  • Metadata: optional cite and datetime explain the change.
  • Choose wisely: edits → del; outdated content → s; never strike.

One line: <del> documents a deletion — usually with a strikethrough, still visible in the HTML.

Default CSS Settings

Typical user-agent styling draws a line through deleted text:

default.css
del {
  text-decoration: line-through;
}

You may add background colors for clearer diffs, but keep contrast accessible and do not remove the semantic meaning of the tag.

Frequently Asked Questions

The del element marks a range of text that has been deleted from a document — for example track-changes or a source diff. Browsers often show it with a line through the text.
Use del when you document an edit (text removed from the document). Use s for content that is no longer accurate or relevant but is not an editorial deletion. Prefer del + ins for revisions.
del marks removed text; ins marks added text. Together they show a revision: old wording struck out and new wording inserted.
cite is a URL that explains the change. datetime is a machine-readable date or date-time of when the deletion happened.
No. The strike element is obsolete. Use del for deletions or s when you need presentational strikethrough for outdated content — not strike.
No. The text stays in the document and is usually visible with a strikethrough. To hide content completely, remove it or use CSS/script — do not rely on del for privacy.

Next: details

Create a disclosure widget with details and summary.

details tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful