Range.isPointInRange()
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The Range.isPointInRange()
method returns a boolean
indicating whether the given point is in the Range
. It returns
true
if the point (cursor position) at offset
within
ReferenceNode
is within this range.
Syntax
bool = range.isPointInRange( referenceNode, offset )
Parameters
Example
range = document.createRange();
range.selectNode(document.getElementsByTagName("div").item(0));
bool = range.isPointInRange(document.getElementsByTagName("p").item(0),1);
Specifications
Specification |
---|
DOM Standard # dom-range-ispointinrange |
Browser compatibility
BCD tables only load in the browser