Selection.focusOffset
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.focusOffset
返回选区终点(鼠标松开瞬间所记录的那个点)在焦点(Selection.focusNode
)中的偏移量。返回值从零开始计数,如果选区(Selection
)在焦点(Selection.focusNode
)的第一个字符前结束,返回值为 0。
语法
offset = sel.focusOffset
规范
Specification |
---|
Selection API # dom-selection-focusoffset |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
focusOffset |
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
, 这个属性所属的接口。