Selection.removeAllRanges()

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.

The Selection.removeAllRanges() method removes all ranges from the selection, leaving the anchorNode and focusNode properties equal to null and leaving nothing selected.

SyntaxEdit

sel.removeAllRanges();

Parameters

None.

SpecificationsEdit

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

Browser compatibilityEdit

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (Yes) (Yes) (Yes) (Yes) (Yes)

See alsoEdit

 

Document Tags and Contributors

 Contributors to this page: teoli, Keysox, BenjamP, fscholz, kosvrouvas, kscarfone, Sheppy, Federico, DR, Rev, Jonnyq
 Last updated by: teoli,