Range: isPointInRange()-Methode
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.
Die Range.isPointInRange()
-Methode gibt einen Boolean zurück, der anzeigt, ob der angegebene Punkt im Range
liegt. Sie gibt true
zurück, wenn der Punkt (Cursor-Position) bei offset
innerhalb des ReferenceNode
in diesem Bereich liegt.
Syntax
js
isPointInRange(referenceNode, offset)
Parameter
Rückgabewert
Ein Boolean.
Beispiele
js
range = document.createRange();
range.selectNode(document.getElementsByTagName("div").item(0));
bool = range.isPointInRange(document.getElementsByTagName("p").item(0), 1);
Spezifikationen
Specification |
---|
DOM # dom-range-ispointinrange |
Browser-Kompatibilität
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.