I am using the JavaScript select event to detect when the user selects a range of characters within a textarea. However, the event does not seem to be invoked when the selection is cleared, either by clicking elsewhere in the textarea, or by moving the caret.
I have tested this in Chrome 12 and Firefox 4
There’s
onblurevent which you can append after a selection has being made 🙂jsFiddle
My idea: create a function which will be executed after the text has been selected, and after it’s being executed unset it … since there’s no text selection any more, and when the text has been selected again – the function will be defined again