Invoke a callback when the user selects text in the page using the mouse or the keyboard.
Install with component(1):
$ component install yields/on-select
var onselect = require('on-select');
var unbind = onselect(el, selected);
function selected(e){
console.log(e);
unbind();
}
Invoke fn(e, str)
when a user selects within el
.
str
is the user selected text.
MIT