How to set date and time when the text was deleted using HTML ?
The <del> tag in HTML stands for delete and is used to mark a portion of text which has been deleted from the document. The deleted text is rendered as strikethrough 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.
The <del> datetime attribute is used to specify the date and time of the deleted text.
<del datetime=""> Contents... </del>
Attribute Values: This attribute contains single value YYYY-MM-DDThh:mm:ssTZD which is used to specify the date and time when the text was deleted.
The explanation of datetime components are listed below:
- YYYY: It sets the year of datetime object (e.g. 2009).
- MM: It sets the month of datetime object (e.g. 05 for March).
- DD: It sets the day of the month of datetime object (e.g. 04).
- T: It is a required separator.
- hh: It sets the hour of datetime object (e.g. 18 for 06.00pm).
- mm: It sets the minutes of datetime object (e.g. 34).
- ss: It sets the seconds of datetime object (e.g. 40).
- TZD: Time Zone Designator (Z denotes Zulu, also known as Greenwich Mean Time)
- Google Chrome
- Internet Explorer