The selectionchange event of the Selection API is fired when the current text selection on a document is changed.

Bubbles No
Cancelable No
Interface Event
Event handler property onselectionchange


document.addEventListener('selectionchange', function() {
  console.log('Selection changed.'); 


Specification Status Comment
Selection API
The definition of 'selectionchange' in that specification.
Working Draft Initial definition.

Browser compatibility

No compatibility data found. Please contribute data for "api.Document.selectionchange_event" (depth: 1) to the MDN compatibility data repository.

See also

Document Tags and Contributors

Last updated by: irenesmith,