Name
Range.setEnd( ): set the end point of a range — DOM Level 2 Range
Synopsis
void setEnd(NoderefNode, longoffset) throws RangeException, DOMException;
Arguments
-
refNode The node that contains the new end point.
-
offset The position of the end point within
refNode.
Throws
A RangeException with a code of INVALID_NODE_TYPE_ERR if
refNode or one of its ancestors is a
DocumentType node.
A DOMException with a code of WRONG_DOCUMENT_ERR if
refNode is part of a different document
than the one through which this range was created, or a code of INDEX_SIZE_ERR if
offset is negative or is greater than
the number of children or characters in
refNode.
Description
This method sets the end point of a range by specifying the
values of the endContainer and
endOffset properties.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access