containsNode method (selectionRange)
Returns whether the specified node is a part of the current selectionRange object.
The selectionRange object represents the current selection, so the containsNode method provides a way to check whether a node is a part of the selection.
You can find the related objects in the Supported by objects section below.
|Required. Reference to the node to check.|
Required. Boolean that indicates whether intersection is allowed.
One of the following values:
Boolean. One of the following values:
|The specified node is not a part of the current selectionRange object.|
|The specified node is a part of the current selectionRange object.|
Example HTML code 1:
This example illustrates the use of the containsNode method:
Did you find this example helpful?
User Contributed Comments