MDN Web Docs

Interfaces

Selection

An interface which represents the part of the document selected by the user or the current position of the caret.

Document.getSelection()

A method returning a Selection object representing the current selection or current position of the caret.

Window.getSelection()

A method returning a Selection object representing the current selection or current position of the caret.

Document.selectionchange

An event which is fired when the current selection is changed.

Node.selectstart

An event which is fired when a user starts a new selection.

Specifications

Specification
Selection API
# selection-interface

Help improve MDN

Yes No

Learn how to contribute

This page was last modified on by MDN contributors.

Read the original on developer.mozilla.org ↗