Basically I need to know when the window.getSelection()
has changed and bind a handler to this event. Ideas?
OBS: Please note that I\'m not looking to b
There is no cross-browser event for that.
However, there does exist an event called selectionchange
, which trigger on every change in a selection in the document, but it is only supported in IE and recent WebKit (Chrome/Safari), so no Firefox/Opera.
You can use the selectionchange
event like this:
$(document).on('selectionchange', function(e) {
console.log('selectionchange', e.originalEvent);
});
jsfiddle example