HTML <del> Tag
Last Updated :
29 Jan, 2024
HTML <del> Tag is used to mark a portion of text that has been deleted from the document. The deleted text is rendered as strike-through text by the web browsers although this property can be changed using CSS text-decoration property. The <del> tag requires a starting and ending tag.
Syntax
<del attr="values"> Contents... </del>
Attributes
The <del> tag contains two attributes which are described below:
cite
|
It is used to specify the URL of the document or message which denotes the reason for deleting the text.
|
datetime
|
It is used to specify the date and time of the deleted text.
|
Supported Attributes
This Tag supprts the Global attribute & the Event Attibute.
Example 1: Illustration of the <del> element in HTML
HTML
<!DOCTYPE html>
< html >
< body >
< h1 >GeeksforGeeks</ h1 >
< h2 >HTML del Tag</ h2 >
< p >
GeeksforGeeks is a
< del >mathematical</ del >
science portal
</ p >
</ body >
</ html >
|
Output:
Example 2: Use of the <del> tag with the datetime attribute. Â
HTML
<!DOCTYPE html>
< html >
< body >
< h1 >GeeksforGeeks</ h1 >
< h2 >HTML del Tag</ h2 >
< p >
GeeksforGeeks is a
< del datetime = "2024-01-03T12:00:00Z" >
mathematical
</ del >
science portal
</ p >
</ body >
</ html >
|
Output:Â
Â
Supported BrowsersÂ
- Google Chrome 1
- Firefox 1
- Opera 15
- Safari 4
- Edge 12
Â
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...