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