monitor-text-selection

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i monitor-text-selection

Weekly Downloads

2

Version

1.1.0

License

MIT

Last publish

Collaborators

  • bmcmahen