/ never-odd-or-even / back / node_modules / toggle-selection /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[DIR]example/10 years ago -  
[TXT]README.md10 years ago547  
[   ]index.js9 years ago780  
[   ]package.json2 years ago1.7K 
README.md

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

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80