selection - Is there a function to deselect all text using JavaScript? -
is there function in javascript deselect selected text? figure it's got simple global function document.body.deselectall();
or something.
try this:
function clearselection() { if ( document.selection ) { document.selection.empty(); } else if ( window.getselection ) { window.getselection().removeallranges(); } }
this clear selection in regular html content in major browser. won't clear selection in text input or <textarea>
in firefox.
Comments
Post a Comment