selectNode method (Range)
Aligns the start and end points of the current Range object to the start and end points of the specified node.
Note: The Range object and its selectNode method are supported in Internet Explorer from version 9.The start and end points mean positions in the DOM hierarchy, not coordinates on the screen.
- The boundary points can be retrieved with the startContainer, startOffset, endContainer and endOffset properties.
- To align the boundary points to the contents of a node, use the selectNodeContents method.
- If you want to modify the start or end point only, use the setStart / setStartBefore / setStartAfter and the setEnd / setEndBefore / setEndAfter methods.
You can find the related objects in the Supported by objects section below.
|Required. Reference to a node to align to.|
This method has no return value.
Example HTML code 1:
This example illustrates the use of the selectNode method:
Did you find this example helpful?
User Contributed Comments