Name
Range.selectNode(): set range boundaries to a node â DOM Level 2 Range
Synopsis
void selectNode(NoderefNode
)
throws RangeException, DOMException;
Arguments
-
refNode
The node to be âselectedâ (i.e., the node that is to become the content of this range).
Throws
A RangeException with a code
of INVALID_NODE_TYPE_ERR
if
refNode
is an Attr, Document, or
DocumentFragment.
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.
Description
This method sets the contents of this range to the specified
refNode
âi.e., it âselectsâ the node and
its descendants.
See Also
Range.selectNodeContents(
)
Get JavaScript: The Definitive Guide, 5th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.