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

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i monitor-text-selection

    Weekly Downloads

    3

    Version

    1.1.0

    License

    MIT

    Last publish

    Collaborators

    • bmcmahen