toggle-selection
v2.1.0
Published
Toggle current selected content in browser
Downloads
44,442,924
Maintainers
Readme
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 selectionAll credits go to @shvaikalesh.
Example

