Loading...
Loading...
00:00:00

<del> and <ins> tag in HTML 

The <del> and <ins> tags in HTML5 are used to indicate deleted or inserted text in a document. These tags are used to highlight changes made to a document and provide context for why the changes were made.

del tag

The <del> tag is used to wrap around text that has been deleted from a document. The text inside the <del> tag is typically displayed with a strike-through line to indicate that it has been deleted. The <del> tag also supports an optional "datetime" attribute, which can be used to indicate the date and time when the text was deleted.

Here's an example of how you might use the <del> tag:

<p>This is some text that has been changed.<del>This part of the text has been deleted.</del></p>

In this example, the text inside the <del> tag will be displayed with a strike-through line, indicating that it has been deleted.

ins tag

The <ins> tag is used to wrap around text that has been inserted into a document. The text inside the <ins> tag is typically displayed with an underline to indicate that it is new. Like the <del> tag, the <ins> tag also supports an optional "datetime" attribute, which can be used to indicate the date and time when the text was inserted.

Here's an example of how you might use the <ins> tag:

<p>This is some text that has been changed.<ins>This part of the text has been inserted.</ins></p>

In this example, the text inside the <ins> tag will be displayed with an underline, indicating that it is new.

The <del> and <ins> tags are useful for tracking changes made to a document, especially in collaborative settings where multiple people are working on a document. By using these tags, you can see who made changes and when they were made, making it easier to keep track of changes over time.

In addition to the semantic meaning, the <del> and <ins> tags also have some default styling that makes it easy to see which text has been deleted or inserted. However, it's important to note that the default styling can be overridden using CSS if you need to change the way that deleted or inserted text is displayed.

Overall, the <del> and <ins> tags provide a convenient way to highlight changes made to a document, making it easier to track changes and understand why they were made. Whether you're working on a document with others or simply making changes to a document on your own, these tags can help you keep track of your changes and ensure that your document is accurate and up-to-date.