Selection.collapseToStart()
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.collapseToStart()
方法的作用是取消当前选区,并把光标定位在原选区的最开始处,如果此时光标所处的位置是可编辑的,且它获得了焦点,则光标会在原地闪烁。
语法
sel.collapseToStart()
参数
无。
规范
Specification |
---|
Selection API # dom-selection-collapsetostart |
浏览器兼容性
BCD tables only load in the browser
参见
- 此方法所属的接口,
Selection
。