Document:caretRangeFromPoint() 方法
非标准: 该特性是非标准的,请尽量不要在生产环境中使用它!
Document
接口的 caretRangeFromPoint()
方法返回指定坐标位置文档片段的 Range
对象。
该方法是 Document.caretPositionFromPoint
方法的 WebKit 专有实现。
语法
js
caretRangeFromPoint(x, y)
参数
返回值
以下之一:
- 一个
Range
。 Null
,当 x 或 y 为负数,超出视口范围或者没有包含文本的节点。
示例
访问 Document.caretPositionFromPoint
页面查看此方法的实时示例。
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
caretRangeFromPoint |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- Non-standard. Check cross-browser support before using.
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.