此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

Selection:collapseToEnd() 方法

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015年7月⁩.

Selection.collapseToEnd() 方法会将选区折叠至选区中最后一个范围的末尾。如果选区内容处于焦点且可编辑,插入点(光标)将会在该位置闪烁。

语法

js
collapseToEnd()

参数

无。

返回值

无(undefined)。

规范

Specification
Selection API
# dom-selection-collapsetoend

浏览器兼容性

参见