HTML <ins> Tag

The HTML <ins> tag represents inserted text in an HTML document.

The <ins> tag can be handy when you need draw attention to text that has been inserted since a previous version of the document.

The <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.

Syntax

The <ins> tag is written as <ins></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).

Like this:

<ins>Inserted text...</ins>

Or with some attributes, like this:

<ins cite="editinfo.htm" datetime="2014-08-24 00:00Z">Inserted text...</ins>

Examples

Basic Usage Example - A "To Do" List

The <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

The 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.

Citations

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

To insert a table row or column, you need to apply the <ins> tag to the content within those rows/columns. You can't simply enclose a <tr> tag or <td> tag within <ins> tags.

The following examples demonstrate inserting table columns and table rows. You can also add styles using CSS if needed. Here, I've applied the CSS background-color property to the <ins> element.

Delete Table Row

Insert Table Row

Remove Underline

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 <ins> element.

Attributes

Attributes can be added to an HTML element to provide more information about how the element should appear or behave.

There are 3 kinds of attributes that you can add to your HTML tags: Element-specific, global, and event handler content attributes.

The <ins> element accepts the following attributes.

Element-Specific Attributes

This table shows the attributes that are specific to the <ins> tag/element.

AttributeDescription
citeIndicates a source that should indicate the reason for the change.
datetimeDate and time of change.

Global Attributes

The following attributes are standard across all HTML5 elements. Therefore, you can use these attributes with the <ins> tag , as well as with all other HTML tags.

  • accesskey
  • class
  • contenteditable
  • contextmenu
  • dir
  • draggable
  • dropzone
  • hidden
  • id
  • inert
  • itemid
  • itemprop
  • itemref
  • itemscope
  • itemtype
  • lang
  • spellcheck
  • style
  • tabindex
  • title
  • translate

For a full explanation of these attributes, see HTML 5 global attributes.

Event Handler Content 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.

Below are the standard HTML5 event handler content attributes.

Again, you can use any of these with the <ins> element, as well as any other HTML5 element.

  • onabort
  • oncancel
  • onblur
  • oncanplay
  • oncanplaythrough
  • onchange
  • onclick
  • oncontextmenu
  • ondblclick
  • ondrag
  • ondragend
  • ondragenter
  • ondragexit
  • ondragleave
  • ondragover
  • ondragstart
  • ondrop
  • ondurationchange
  • onemptied
  • onended
  • onerror
  • onfocus
  • onformchange
  • onforminput
  • oninput
  • oninvalid
  • onkeydown
  • onkeypress
  • onkeyup
  • onload
  • onloadeddata
  • onloadedmetadata
  • onloadstart
  • onmousedown
  • onmousemove
  • onmouseout
  • onmouseover
  • onmouseup
  • onmousewheel
  • onpause
  • onplay
  • onplaying
  • onprogress
  • onratechange
  • onreadystatechange
  • onscroll
  • onseeked
  • onseeking
  • onselect
  • onshow
  • onstalled
  • onsubmit
  • onsuspend
  • ontimeupdate
  • onvolumechange
  • onwaiting

For a full explanation of these attributes, see HTML 5 event handler content attributes.

Differences Between HTML 4 & HTML 5

None.

To see more detail on the two versions see HTML5 <ins> Tag and HTML4 <ins> Tag. Also check out the links to the official specifications below.

Template

Here's a template for the <ins> tag with all available attributes for the tag (based on HTML5). These are grouped into attribute types, each type separated by a space. In many cases, you will probably only need one or two (if any) attributes. Simply remove the attributes you don't need.

For more information on attributes for this tag, see HTML5 <ins> Tag and HTML4 <ins> Tag.

<ins  
 cite=""
 datetime=""
 
 accesskey=""
 class=""
 contenteditable=""
 contextmenu=""
 dir=""
 draggable=""
 dropzone=""
 hidden=""
 id=""
 itemid=""
 itemprop=""
 itemref=""
 itemscope=""
 itemtype=""
 lang=""
 spellcheck=""
 style=""
 tabindex=""
 title=""
 translate=""

 onabort=""
 onautocomplete=""
 onautocompleteerror=""
 onblur=""
 oncancel=""
 oncanplay=""
 oncanplaythrough=""
 onchange=""
 onclick=""
 onclose=""
 oncontextmenu=""
 oncuechange=""
 ondblclick=""
 ondrag=""
 ondragend=""
 ondragenter=""
 ondragexit=""
 ondragleave=""
 ondragover=""
 ondragstart=""
 ondrop=""
 ondurationchange=""
 onemptied=""
 onended=""
 onerror=""
 onfocus=""
 oninput=""
 oninvalid=""
 onkeydown=""
 onkeypress=""
 onkeyup=""
 onload=""
 onloadeddata=""
 onloadedmetadata=""
 onloadstart=""
 onmousedown=""
 onmouseenter=""
 onmouseleave=""
 onmousemove=""
 onmouseout=""
 onmouseover=""
 onmouseup=""
 onmousewheel=""
 onpause=""
 onplay=""
 onplaying=""
 onprogress=""
 onratechange=""
 onreset=""
 onresize=""
 onscroll=""
 onseeked=""
 onseeking=""
 onselect=""
 onshow=""
 onsort=""
 onstalled=""
 onsubmit=""
 onsuspend=""
 ontimeupdate=""
 ontoggle=""
 onvolumechange=""
 onwaiting=""
	>
</ins>

Tag Details

For more details about the <ins> tag, see HTML5 <ins> Tag and HTML4 <ins> Tag.

Specifications

Here are the official specifications for the <ins> element.

What's the Difference?

W3C creates "snapshot" specifications that don't change once defined. So the HTML5 specification won't change once it becomes an official recommendation. WHATWG on the other hand, develops a "living standard" that is updated on a regular basis. In general, you will probably find that the HTML living standard will be more closely aligned to the current W3C draft than to the HTML5 specification.