Skip to content
Related Articles
Open in App
Not now

Related Articles

How to define a text that has been deleted from the document in HTML5 ?

Improve Article
Save Article
Like Article
  • Last Updated : 31 Mar, 2021
Improve Article
Save Article
Like Article

In this article, we will learn how to define some text that has been deleted from the document. 

This can be used to show a recent update in content or remove content that may be incorrect. It is usually followed by text that has been updated or corrected.

We will use the <del> element to specify text that has been deleted from the document. The browser will usually strike through the text present in this tag to distinguish it from the rest of the content. This element has two attributes that can be used to specify the citation and the time that the change was made.

Syntax:

<del>Deleted text</del>

The below example illustrates the <del> element to define the text that has been deleted from the document.

Example:

HTML




<html>
<body>
  <h1 style="color: green;">
    GeeksforGeeks
  </h1>
  
  <b>
    How to define a text that has
    been inserted into a document
  </b>
  
  <p><del>This line has been deleted.</del></p>
  <p>The venue for the event is the 
    <del cite="https://www.geeksforgeeks.org" 
         datetime="2018-11-21T15:55:03Z">
      Auditorium
    </del> <ins>Open Air Theatre</ins>.
  </p>
  
</body>
</html>

Output:

del element

My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!