Selection.anchorOffset
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.
只读属性,返回选区的锚节点( Selection.anchorNode
)起点偏移量的数字。返回值从零开始计数,如果选区从锚节点(Selection.anchorNode
)的第一个字符开始,返回值为 0。
语法
number = sel.anchorOffset
规范
Specification |
---|
Selection API # dom-selection-anchoroffset |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
anchorOffset |
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.
相关内容
Selection
, the interface it belongs to.