We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

概述

Selection.anchorNode 只读属性返回选区开始位置所属的节点(Node)。

用法

sel.anchorNode

注意

用户可能从左至右进行框选(沿着文字顺序)或者从右至左框选(沿着文字顺序的反方向)。锚点位于用户开始选择的位置。可以通过按住Shift和方向键来得知锚点所在的位置。选区的锚点是不会移动的,但是选区的焦点、选区其他的结束位置(多个选区,译者注)可以移动。

说明

说明 状态 注释
HTML Editing APIs
Selection.anchorNode
Editor's Draft Initial definition
Selection API
Selection.anchorNode
Working Draft Current

浏览器兼容性

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support ? (Yes) ? ? ?
Feature Android Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support ? (Yes) 1.0 ? ? ?

相关链接

文档标签和贡献者

此页面的贡献者: mominbin, dclovec, teoli, jsx, Losses
最后编辑者: mominbin,