monitor-text-selection
v1.1.0
Published
emit event for the selection and deselection of text for any given element'
Downloads
5
Maintainers
Readme
monitor-select
emit events for selection and deselection of text for a given element.
Installation
Install with component(1):
$ component install bmcmahen/monitor-text-selection
Example
var el = document.querySelector('#text');
var monitor = require('monitor-text-selection')(el);
monitor.on('selected', function(e, el){
console.log('selected');
});
monitor.on('deselected', function(e, el){
console.log('deselected');
});
// unbind
monitor.unbind();
License
MIT