Is there a function in javascript to just deselect all selected text? I figure it’s got to be a simple global function like document.body.deselectAll(); or something.
Is there a function in javascript to just deselect all selected text? I figure
Share
Try this:
This will clear a selection in regular HTML content in any major browser. It won’t clear a selection in a text input or
<textarea>in Firefox.