ins (HTML element)
Example
The following text was hastily revised, yet the author chose to identify what was changed:
<p>Bernie enjoyed nothing more than a <del
datetime="2007-11-05T23:31:05Z">night out on the town at his
favorite drag queen show</del> <ins
datetime="2007-11-05T23:33:32Z">quiet night in with a warm cup of
cocoa</ins></p>
- Type
- inline element or block-level element (depending on context)
- Contains
- inline elements, block-level elements
- Contained by
- inline elements, block-level elements
Description
The
ins element is used to indicate a change to the
document that saw the author insert content which wasn’t included in an
earlier version. If you’re familiar with the Track Changes tool in
Microsoft Word, you can think of ins as HTML’s slightly
simplified equivalent.
ins can be used to
identify anything from a specific word or phrase that’s been inserted (in
which case the ins is deemed to be an inline element)
to an entire block of content, which could include a number of nested
block-level elements (in this case, the ins is deemed
to be a block-level element).
The
ins element has a counterpart in the del element, which is used to identify a
deletion from a document.
Both elements have optional attributes that provide extra information about the change to the document, namely the cite and datetime attributes.
The example HTML above would render as shown in Figure 1.
ins
element
Whether an ins element is
determined to be inline or block-level depends on the context in which
it’s used. If the ins is an immediate child of
body (with a Strict Doctypes declaration), it’s a block-level
element. If it’s a child of a p element, it’s deemed
to be an inline element.
Note that a
ins element can’t contain block-level child elements
when it’s used in a context that would make it inline (for example, an
ins contained inside a p can’t
contain a block-level element).
Use This For …
This element can be applied to inline text content, or blocks of content.
Compatibility
| IE | 5.5 | Partial |
|---|---|---|
| 6.0 | Partial | |
| 7.0 | Partial | |
| Firefox | 1.0 | Partial |
| 1.5 | Partial | |
| 2.0 | Partial | |
| Safari | 1.3 | Partial |
| 2.0 | Partial | |
| 3.0 | Partial | |
| Opera | 9.2 | Partial |
| 9.5 | Partial |
The
ins element has good browser support; all the major
browsers render inserted text with an underline (although this effect
could be restyled using CSS as appropriate).
The browser support
charts show partial rather than full support for this element, because of
the lack of obvious support for the element-specific attributes
(cite and
datetime).
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

