HTML <ins> Tag
<ins> tag represents inserted text in an HTML document.
<ins> tag can be handy when you need draw attention to text that has been inserted since a previous version of the document.
<ins> tag is sometimes used along with the
<del> tag for markup of deleted text.
Browsers usually underline inserted text and strike a line through deleted text. However, as with any HTML element, you can apply your own styles to the
<ins> element using CSS.
<ins> tag is written as
</ins> with the inserted text enclosed between the start and end tags. You can use attributes such as
cite (to link to the source of the quotation or more information about the edit) and
datetime (to specify the date and/or time of the edit).
Or with some attributes, like this:
Basic Usage Example - A "To Do" List
<ins> tag can be used in a "to do" list to markup items that have been added to the list. In this example, I've also used the
<del> tag to indicate that the first item has been done.
Date & Time
datetime attribute allows you to add a date and (optionally) a time. This attribute is mainly intended for private use (e.g. by server-side scripts collecting statistics about a site's edits), but it could potentially be displayed to users.
Here, we can add date and time information to the
<ins> tag and the
<del> tag to indicate items that have been added.
You can add a citation using the
cite attribute. The value of this attribute must be the URL of a document that explains the change. This attribute is not intended for readers of the document. Rather, it is intended for private use (e.g. by server-side scripts collecting statistics about a site's edits).
Inserting Table Rows &/or Columns
Delete Table Row
Insert Table Row
Most browsers apply an underline to the
<ins> element. While this can be useful, it can also potentially confuse your users, as they might mistaken the inserted text for a hyperlink and try clicking on it.
You can always use the CSS text-decoration property to remove the underline and style your
<ins> elements in another way. In this example, we remove the underline and apply a background-color to the
Attributes can be added to an HTML element to provide more information about how the element should appear or behave.
<ins> element accepts the following attributes.
|Indicates a source that should indicate the reason for the change.|
|Date and time of change.|
The following attributes are standard across all HTML elements. Therefore, you can use these attributes with the
<ins> tag , as well as with all other HTML tags.
For a full explanation of these attributes, see HTML 5 global attributes.
Event handler content attributes enable you to invoke a script from within your HTML. The script is invoked when a certain "event" occurs. Each event handler content attribute deals with a different event.
Most event handler content attributes can be used on all HTML elements, but some event handlers have specific rules around when they can be used and which elements they are applicable to.
For more detail, see HTML event handler content attributes.