--- title: Selection.collapseToEnd() slug: Web/API/Selection/collapseToEnd translation_of: Web/API/Selection/collapseToEnd ---
Selection.collapseToEnd()
方法的作用是取消当前选区,并把光标定位在原选区的最末尾处,如果此时光标所处的位置是可编辑的,且它获得了焦点,则光标会在原地闪烁。
sel.collapseToEnd()
无
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML Editing', '#dom-selection-collapsetoend', 'Selection.collapseToEnd()')}} | {{Spec2('HTML Editing')}} | Initial definition |
{{SpecName('Selection API', '#widl-Selection-collapseToEnd-void', 'Selection.collapseToEnd()')}} | {{Spec2('Selection API')}} | Current |