TOC PREV NEXT INDEX

domref



collapse


Collapses the Range to one of its boundary points.

Syntax

range.collapse(toStart);
 

Parameters

The collapse method takes the following parameters:

toStart
 

A boolean, true collapses the Range to its start, false to its end.


Example

range = document.createRange();
 
referenceNode = document.getElementsByTagName("div").item(0);
 
range.selectNode(referenceNode);
 
range.collapse(true);
 

Notes

A collapsed Range is empty, containing no content, specifying a single-point in a DOM tree. To determine if a Range is already collapsed, see the collapsed property.

Specification

collapse


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX