ins Element


 

Module

The ins element is declared by the XHTML 1.1 Edit Module

Elements in the Edit Module are:
ins | del

Description

The ins element is used to mark up content which has been inserted into the document since the last version. See also the del element.

The cite attribute may be used to provide a URI which gives the reason for the change and the datetime attribute may be used to indicate the date and time of the change. A title attribute may also be added to provide a brief reason for the addition. No browser of which I am aware automatically presents the value of either the cite or the datetime attribute to the user. This means that, to obtain this information, the user must either view the document's source code or use browser-specific methods of retrieving the data - for example, in certain browsers (e.g. Firefox) right-clicking over the element and selecting Properties will bring up this information. Alternatively, scripting may be used to render this content on the page.

ins and del are not routinely used on web pages but are useful in specific circumstances, such as for draft specifications or legal documents, where it is necessary to be able to tell at a glance what has changed since the previous version of the document (and possibly also when and why).

Examples:

  • <ins cite="changes/why-ins-sec11.html" title="Additional section to cater for XYZ">
      <div class="section">
      <h3>Section 11</h3><p>This section is concerned with...</p>
      </div>
    </ins>
  • as stated in Section <del datetime="2006-05-28">11.2</del><ins datetime="2006-05-28">12.2</ins>

These examples render as:

  • Section 11

    This section is concerned with...

  • as stated in Section 11.212.2

There is no styling applied to the rendered examples above and so they appear according to your browser's default behaviour. Commonly inline ins content is underlined and inline del content is given a strike-through. Block level content, however, is sometimes not styled differently at all - it is therefore a good idea for the author to use CSS to explicitly style the changed content - for example one could make sure all inserted text, block and inline, is underlined and also given a blue background using the rule:
ins, ins * { text-decoration:underline; background-color:#ccf }

Note on element placement

Although the Content Model for ins theoretically allows the following code (which will pass W3C Validation):

<p>The meeting took place at Head Office <ins><div>256 Big Cheese Road, Hippotown</div></ins> at 3:30pm on 14th March 2006.</p>

this is not a suitable use of the element. The general rule is that the document should still validate after the ins element is removed and replaced by its content. In the case of the last example, removing the ins element gives:

<p>The meeting took place at Head Office <div>256 Big Cheese Road, Hippotown</div> at 3:30pm on 14th March 2006.</p>

which is not valid XHTML 1.1, since div cannot be a child of p.

#REQUIRED Attributes

There are no #REQUIRED attributes on the ins element.


Specific Attributes

Specific attributes of the ins element are listed below:

From the Edit Module - the Element's own Module

cite [ type URI ]
URI which specifies a reason for the insertion
datetime [ type Datetime ]
When the insertion was made

Common Attributes

Common attributes of the ins element are listed below:

From the Core Attribute Collection

class [ type NMTOKENS ]
One or more space separated classes
id [ type ID ]
A unique identifier for the element
style [ type CDATA ], from the Style Attribute Module (deprecated)
Element-specific styles
title [ type Text ]
Descriptive title for the element (in some user agents this may appear as a "tooltip" when the mouse hovers over the element)
xmlns [ type URI - #FIXED 'http://www.w3.org/1999/xhtml' ]
XML namespace

From the I18N Attribute Collection

dir [ type Enumeration (ltr | rtl) ], from the Bi-directional Text Module
Left-to-right or right-to-left directionality
xml:lang [ type LanguageCode ]
A language code for the element

From the Events Attribute Collection

All attributes in the Events Attribute Collection are supported:
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup


Content Model

The Content Model for the ins element is:

( #PCDATA | Flow.mix )*

See Content Model & Nesting for information about Content Model syntax and Nesting Groups.

Valid children of ins

Valid parents of ins


Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 01 Oct 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Element Index (XHTML 1.1) > ins Element