Coding Hubs School of AI – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 8448811540
Back to HTML Notes
Topic #212

Deleted Text (del)

The <del> tag marks content that has been removed from a document — typically shown with a strikethrough. It's commonly paired with <ins> to show a tracked change.

Syntax

<del cite="https://example.com/changelog" datetime="2026-08-20">removed text</del>

Basic Example

<p>Price: <del>₹6,999</del> <ins>₹4,999</ins></p>

Browser output: "₹6,999" appears with a strikethrough, and "₹4,999" appears underlined right after it — a familiar e-commerce "was/now" price pattern.

How It Works

The browser applies text-decoration: line-through by default. The cite and datetime attributes carry extra machine-readable meaning that isn't shown visually at all — they're there for tools and archives that need to know exactly what changed and when.

Important Attributes

AttributePurpose
citeA URL pointing to a page that explains the change (not visible to readers)
datetimeThe date/time the content was removed, in ISO 8601 format (e.g. 2026-08-20)

Real-World Example

<p>
    Course start date: <del datetime="2026-08-01">September 1</del>
    <ins datetime="2026-08-15">September 15</ins>
</p>

A rescheduling notice on a course page — the old date is struck through, the new date is shown right after, both dated for a clear audit trail.

Common Mistakes

  • Using <del> purely for decorative strikethrough styling with no real "this was removed" meaning — that's more honestly a job for the <s> element or CSS
  • Confusing <del> with <s> — <del> means "this was edited out of a revision"; <s> means "this is no longer accurate or relevant" (like a sold-out product) without implying a tracked document edit

Best Practices

  • Pair <del> with <ins> whenever you're showing a genuine before/after change
  • Include datetime (and cite when relevant) for anything where the exact timing of a change matters

Accessibility Considerations

Some screen readers announce "deletion start/end" around <del> content. Don't rely on the strikethrough color alone to convey the removal — make sure the surrounding text (like showing the new price right next to it) also makes the change clear.

SEO Considerations

No direct ranking effect.

Browser & Modern HTML Notes

<del> is stable and well-supported; it's worth knowing the related <s> element exists for the "no longer accurate/relevant" case that isn't really a document edit.

Mini Practice

  1. Build a "was/now" pricing line using <del> and <ins>.
  2. Add a datetime attribute to a <del> showing exactly when content was removed.

Related HTML Notes

Want to go beyond the notes?

Join Coding Hubs School of AI's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →