Range: isPointInRange() method
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.
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
js
isPointInRange(referenceNode, offset)
Parameters
Return value
A boolean.
Examples
js
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
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
isPointInRange |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.