Range: isPointInRange() メソッド
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.
Range.isPointInRange()
メソッドは、指定されたこの点が Range
内にあるかどうかを示す論理値を返します。このメソッドは ReferenceNode
内の offset
にある点(カーソル位置)がこの範囲内にある場合に true
を返します。
構文
js
isPointInRange(referenceNode, offset)
引数
返値
論理値です。
例
js
range = document.createRange();
range.selectNode(document.getElementsByTagName("div").item(0));
bool = range.isPointInRange(document.getElementsByTagName("p").item(0), 1);
仕様書
Specification |
---|
DOM # dom-range-ispointinrange |
ブラウザーの互換性
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.