Selection.focusNode
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.focusNode
是只读的,返回所选内容的结束位置部分所属的节点。
用户可能会从左到右 (按文字方向) 或从右到左 (按文字相反方向) 进行选择。focusNode 就是用户选择时最后停下来所处的元素节点。当你同时按下 shift 键和任何一个方向键来改变选择时,你就能看到:选择的结束位置在移动,但是选择的锚点 - 起始位置不会改变。
语法
node = sel.focusNode
规范
Specification |
---|
Selection API # dom-selection-focusnode |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
focusNode |
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
, Selection 接口规范。