O'Reilly logo

XML Companion, The, Third Edition by Neil Bradley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Ranges

Modern word processors allow a range of text to be selected by clicking the mouse at the start-point, and dragging across and down to the end-point, leaving the selected area highlighted to show its scope. After selection, the user can select 'delete' or 'copy' from a menu. This concept can also be applied to DOM trees. The new Ranges module of the DOM standard provides a standard way to define and modify a range of data that may include nodes of various types, including text and element nodes.

Parser support

The hasFeature method can be used to discover whether or not a parser supports this module:

if ( myDOM.hasFeature("Range", "2.0") == true )
{
  // Ranges are supported
}

Range scope

A range is defined by a start-point and an end-point. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required