Name Last Update
..
example Loading commit data...
.npmignore Loading commit data...
README.md Loading commit data...
index.js Loading commit data...
package.json Loading commit data...

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.

Example

example recording