XML DOM setEnd() method

Definition and usage

The setEnd() method sets the end point of the range.

Syntax:

selectNodeContents(refNode,offset)

Parameters

Parameters Description
refNode The node containing the new end point.
offset The end point is in refNode in the position.

throw

If refNode or one of its ancestor nodes is a DocumentType node, this method will throw an error code of INVALID_NODE_TYPE_ERR. RangeException exception.

If refNode The document owned by this method is different from the document that created the range, this method will throw an error code of WRONG_DOCUMENT_ERR. DOMException exception.

If offset is negative, or greater than refNode The number of child nodes or character numbers, this method will throw an error code of INDEX_SIZE_ERR. DOMException exception.

Description

This method will set the end point of the range to the value specified by the endContainer property and endOffset property.