XML DOM collapse() method

Definition and usage

The collapse() method is the overlap of the boundary points of the range.

Syntax:

collapse(toStart)

Parameter

If the parameter toStart Setting this to true, this method will set the end point of the range to be the same as the start point. Otherwise, it will set the start point of the range to be the same as the end point.

Description

This method sets a boundary point of the range to be the same as another boundary point. The boundary point to be modified is specified by the parameter toStart Specify. After this method returns, the range will be 'collapsed', which means a point in the document with no content. When the range is collapsed, its collapsed property will be set to true.