Selection.collapseToEnd()

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

Selection.collapseToEnd() 方法的作用是取消当前选区,并把光标定位在原选区的最末尾处,如果此时光标所处的位置是可编辑的,且它获得了焦点,则光标会在原地闪烁。

语法

sel.collapseToEnd()

参数

规范

Specification
Selection API
# dom-selection-collapsetoend

浏览器兼容性

BCD tables only load in the browser

相关链接