$ npm install toggle-selection
Simple module exposing function that deselects current browser selection and returns function that restores selection.
var deselect = require('toggle-selection');
var reselect = deselect(); // remove all selection
// …
// do something with current selection, text, etc;
// …
reselect(); // restore selection
All credits go to @shvaikalesh.
© 2010 - cnpmjs.org x YWFE | Home | YWFE