This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The Selection.collapseToEnd() method collapses the selection to the end of the last range in the selection.  If the content of the selection is focused and editable, the caret will blink there.

Syntax

sel.collapseToEnd()

Parameters

None.

Specifications

Specification Status Comment
HTML Editing APIs
The definition of 'Selection.collapseToEnd()' in that specification.
Editor's Draft Initial definition
Selection API
The definition of 'Selection.collapseToEnd()' in that specification.
Working Draft Current

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
Experimental
Chrome Full support YesEdge Full support YesFirefox Full support YesIE ? Opera ? Safari ? WebView Android ? Chrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support YesOpera Android ? Safari iOS ? Samsung Internet Android ?

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.

See also

Document Tags and Contributors

Last updated by: ddbeck,