ins element

If you don't know what an element is or how you must use it, I recommend you read the "HTML tags and attributes" tutorial that you can find in the HTML tutorials section.

Description

The ins element represents content that has been added to the document. This element, together with the del element, allows authors to make public editorial changes made to the document. This is useful when the document's readers could benefit from knowing what changes have been applied to it to amke it reach its current state.

The attributes cite and datetime can be used to provide more information about the update. While cite contains the URI of a resource providing an explanation of the update, datetime can provide a date and time when the changes took effect. Keep in mind that the contents of datetime must comply with the following formats.

Dates

A date syntax is composed by:

  1. A valid month syntax representing year and month.
  2. A minus sign or hypen character ("-").
  3. A two digits day between 1 and the numbers of days for the previously specified month and year.

Example

<time>2014-07-05</time>
<time>1920-12-31</time>

Global dates and times

A global date and time syntax is composed by:

  1. A valid date syntax representing year, month and day.
  2. A capital letter T or a space character (" ").
  3. A valid time syntax representing the time.
  4. A valid time zone syntax representing the time-zone offset.

Example

<time>2014-01-14 00:12-03:00</time>
<time>2014-05-16T20:12+00:30</time>
<time>2201-08-20 03:04:22.5-5:00</time>
<time>2000-04-01T02:00:00.00+4:00</time>

For a global date and time syntax to be a normalised forced-UTC global date and time string, it must be composed by:

  1. A valid date syntax representing year, month and day, converted to UTC time zone.
  2. A capital letter T.
  3. A valid time syntax representing the time, converted to UTC time zone and in its shortest variant (for example, omitting the number of seconds when it's zero).
  4. A capital letter Z.

Example

<time>2014-02-03T22:00Z</time>
<time>2010-01-01T00:00:00.001Z</time>
<time>2050-01-03T23:59Z</time>
<time>1980-12-23T00:05Z</time>

To create a date or a global date and time, you may need some of the following formats:

Months

A month syntax is composed by:

  1. A year greater than zero, consisting of at least four digits.
  2. A minus sign or hypen character ("-").
  3. A month between 1 and 12, consisting of two digits.

Example

<time>2014-07</time>
<time>0512-12</time>

Times

A time syntax is composed by:

  1. Two digits representing an hour between 0 and 23.
  2. A colon character (":").
  3. A two digits minute between 0 and 59.
  4. The following information, which is optional if the number of seconds is zero:
    1. A colon character (":").
    2. Two digits representing the integer part of the seconds, between 0 and 59.
    3. The following information, which is optional if the number of seconds is an integer:
      1. A period or full stop character (".").
      2. The fractional part of the seconds composed by one, two or three digits.

Example

<time>23:59:59.999</time>
<time>10:20:00.000</time>
<time>10:20</time>
<time>10:20:00</time>

Time zones

A time zone syntax is composed by:

  1. A minus sign or hypen character ("-") if the offset is negative, and a plus sign character ("-") otherwise.
  2. Two digits representing an hour between 0 and 23.
  3. Optionally, a colon character (":").
  4. A two digits minute between 0 and 59.

Example

<time>-12:00</time>
<time>+00:00</time>
<time>+00:30</time>
<time>-1100</time>

This format allows a range of time zones wider than what's currently used in practice. The reason for this excess is to improve adaptability to future time zones changes, as they are subject to political decisions.

The ins element can contain both, flow (blocks of content usually composed by one or more elements) or phrasing content (small runs of text).

Examples

In the example below, we hace a pice of document where the author has marked the added text with the ins element to make clear what's been inserted. Here, it's just containing a run of text (phrasing content).

<p>...law allows male<ins> and female</ins> citizens to vote for their political representatives...</p>

...law allows male and female citizens to vote for their political representatives...

Now, another document with changes made visible, this time, with a full paragraph being added. Here, also the date and an explanation of the update are provided in the attributes cite and datetime respectively. Remember that cite takes a URI for value, and the contents of datetime must comply with the formats of dates and global dates and times.

<p>...The program supports the formats wav, mp3, and wma.</p>
<ins cite="#update4" datetime="2014-04-01 02:15:11">
  <p>Note: from version 2 and forth, the ogg format is also suported.</p>
</ins>

...The program supports the formats wav, mp3, and wma.

Note: from version 2 and forth, the ogg format is also suported.

In the third and last example, both ins and del are used to mark a replacement of one piece of text by another. From the contents of this example only, you can work out that the difficulty level of the game has been adjusted to become more challenging.

<p>The rules of this game only permit a total of <del>ten shots in a period of 40 seconds (maximum)</del><ins>five shots in a period of 20 seconds (maximum)</ins>.</p>

The rules of this game only permit a total of ten shots in a period of 40 seconds (maximum)five shots in a period of 20 seconds (maximum).

Attributes

Specific attributes

cite

The URI of a resource providing an explanation about the update (why the content was added?, in conclussion to what debate?, agreed by what percentage of the participants?, etc.)

Example

<p>...<ins cite="why-the-updates.html#update12">by four or more members of the party</ins>...</p>

datetime

The date or time when the content has been added. Data in this attribute must comply with the regulations of dates and global dates and times.

Example

<p>...<ins datetime="2011-01-01">the regional delegate must present the project to the board</ins>...</p>

Global attributes

For information about global attributes refer to this list of global attributes in HTML5.

Events

Global events

For information about global events refer to this list of global events in HTML5.