w3resource

HTML del tag and element

1. HTML del (deleted text) element represents a run of text, which has been deleted from a document, while a different version of the document had that text.

2. Often HTML del element is used along with del element.

3. While displaying a deleted text, most of the browsers put a line through on the text.

Syntax

<del>text</del> 

Category

HTML del element can be used as an inline element as well as a block level element.

Whether both start and end tags are required

Yes.

Can contain

HTML del element can contain inline elements and block level elements. If this element is used as an inline element, not block level element should be used within the del element.

The following example is an inappropriate use of ins element.

<p><del><div>Some text..... </del></div></p> 

Can reside within

HTML del element can reside within inline as well as block level elements.

Attributes

Attributes specific to this element

Attribute Value Description
cite An url. Value of the attribute points to a source document or message.
datetime Date and time. Value of the attribute specifies the date time, when the text had been deleted.

Identifiers

id, class.

language information and text direction

lang, dir.

Title

Title.

Style

Style.

Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup.

Supported doctypes

HTML 4.01 Strict, HTML 4.01 Transitional, and HTML 4.01 Frameset.

Example of using HTML del element

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>html del tag example</title>
</head>
<body>
<p><del datetime="2011-01-05T08:15:30+05:30" cite="https://www.w3resource.com/html/HTML-tutorials.php">We are not using HTML 4.01 Transitional DOCTYPE.</del></p>
</body>
</html>

Result

html del element

View this example in a separate browser window

HTML del tag example.

Pictorial presentation

html del tag

Previous: HTML ins tag and element
Next: HTML-lists

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/html/del/HTML-del-tag-and-element.php