I have a draggable (jQuery UI) element with "canceled" text on it. Here's what I mean:
$('#main').draggable({
cancel: '#main>* *',
start: function(){
// deselect text
}
});
When I drag the element, I often select the text by accident. I want to deselect the text when the element is dragged.
$('#main'). draggable({ cancel: '#main>* *', start: function(){ // deselect text } });
To deselect everything you can use:
document.getSelection().removeAllRanges();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With