Web features explorer

Selection

Widely available
Tags: api Groups: Selection

The Selection API controls and modifies user text selections within the page. To learn more, see AbstractRange, AbstractRange: collapsed property, AbstractRange: endContainer property, AbstractRange: endOffset property, AbstractRange: startContainer property, AbstractRange: startOffset property, Document: createRange() method, Document: getSelection() method, Document: selectionchange event, HTMLInputElement: selectionchange event, HTMLTextAreaElement: selectionchange event, Node: selectstart event, Range, Range: Range() constructor, Range: cloneContents() method, Range: cloneRange() method, Range: collapse() method, Range: collapsed property, Range: commonAncestorContainer property, Range: compareBoundaryPoints() method, Range: comparePoint() method, Range: deleteContents() method, Range: detach() method, Range: endContainer property, Range: endOffset property, Range: extractContents() method, Range: insertNode() method, Range: intersectsNode() method, Range: isPointInRange() method, Range: selectNode() method, Range: selectNodeContents() method, Range: setEnd() method, Range: setEndAfter() method, Range: setEndBefore() method, Range: setStart() method, Range: setStartAfter() method, Range: setStartBefore() method, Range: startContainer property, Range: startOffset property, Range: surroundContents() method, Range: toString() method, Selection, Selection: addRange() method, Selection: anchorNode property, Selection: anchorOffset property, Selection: collapse() method, Selection: collapseToEnd() method, Selection: collapseToStart() method, Selection: containsNode() method, Selection: deleteFromDocument() method, Selection: direction property, Selection: empty() method, Selection: extend() method, Selection: focusNode property, Selection: focusOffset property, Selection: getRangeAt() method, Selection: isCollapsed property, Selection: modify() method, Selection: rangeCount property, Selection: removeAllRanges() method, Selection: removeRange() method, Selection: selectAllChildren() method, Selection: setBaseAndExtent() method, Selection: setPosition() method, Selection: toString() method, Selection: type property, StaticRange, StaticRange: StaticRange() constructor, StaticRange: collapsed property, StaticRange: endContainer property, StaticRange: endOffset property, StaticRange: startContainer property, StaticRange: startOffset property, Window: getSelection() method at MDN.

Compatibility (view on caniuse.com)

Specifications