How to set date and time when the text was deleted using HTML?

When working with HTML to create a web content, it is common to make changes to text and remove old or wrong information. It is important to keep the content up-to-date, while it is also important to keep a record of when changes are made. In HTML, setting the date and time when the text was deleted is a simple process.

Syntax

content?. 

Here is a datetime attribute in the del element, which specifies the date and time when the text was deleted.

Using the Del Element in HTML

We use tag, to delete a text in HTML. This tag mark strike on the text which is to be delete from the document. for example ?

We are using CSS CSS 3 for web development.

Here, we have set the "datetime" attribute in the del element, which specifies the content of the time when the text was deleted.

Example

Here is an example of how to set date and time when the text was deleted using HTML.



   


   

This is an example of how to use the del element to
specify the date and time when the text was deleted

We are using CSS CSS 3 for web development.

Using the Time Element in HTML

In HTML, the time element is used to represent a specific date and time. It is used to display timestamps for various types of events on a webpage, including when text was deleted. By using the time element for the deleted text, we can add a timestamp for when the text was deleted. For example ?

This text will be deleted :

Here, the text "This text will be deleted:" is followed by the time element. We have set the "datetime" attribute in the time element, which specifies the content of the time when the text was deleted. The text content of the Time element displays the date and time in a readable format.

Example

Here is an example of how to use the Time element to add a timestamp for deleted text.



   


   

This is an example of how to use the Time element to
add a timestamp for deleted text

This text will be deleted:

Conclusion

Here, we discussed how to set the date and time when the text was deleted using HTML. In HTML, Setting the date and time when the text was deleted is a simple process by using the del element and time element.

Updated on: 2023-04-12T15:35:49+05:30

225 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements