Selection.extend()
Selection.extend() 方法移动选中区的焦点到指定的点。选中区的锚点不会移动。选中区将从锚点开始到新的焦点,不管方向。
语法
sel.extend(node, offset)
参数
- node
-
焦点会被移至此节点内。
- offset 可选
-
焦点会被移至
node内的偏移位置。如果没有指定,使用0作为默认值。
规范
| Specification |
|---|
| Selection API # dom-selection-extend |
浏览器兼容性
BCD tables only load in the browser
相关链接
Selection, 此方法所属接口。