XML DOM selectNode() method

Definition and usage

The selectNode() method sets the range boundary to a node.

Syntax:

selectNode(refNode)

Parameter

Parameter Description
refNode The selected node (which will become the node of the current range's content).

throw

If refNode is Attr, Document, or Notation node, this method will throw a 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, and this method will throw a code of WRONG_DOCUMENT_ERR DOMException exception.

Description

This method will set the content of the range to the specified refNode Node. That is, 'select' that node and its descendants.

See

Range.selectNodeContents().