Is there a standard cross-browser HTML5 event which corresponds to IE legacy onselectionchange (so it is fired when the current selection changes)?
EDITED, I'm looking to track Selection object changes.
Never too late :
// IE
myEditableElement.onselectionchange = onSelectionChange;
// work on chrome, untested on firefox
myEditableElement.addEventListener('focus', function (event) {
document.addEventListener('selectionchange', onSelectionChange);
});
myEditableElement.addEventListener('focusout', function (event) {
document.removeEventListener('selectionchange', onSelectionChange);
});
// Event
function onSelectionChange (event) {
// todo
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With