Open In App

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

Improve
Improve
Like Article
Like
Save
Share
Report

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: In this example, we are using the above-explained approach.

HTML




<!DOCTYPE html>
<html lang="en">
<head>
    <title>
          How to define a text that has been deleted
          from the document in HTML5 ?
      </title>
</head>
<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


Last Updated : 06 Jun, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads