I have a draggable (jQuery UI) element with \"canceled\" text on it. Here\'s what I mean:
$(\'#main\').draggable({ cancel: \'#main>* *\', star
To deselect everything you can use:
document.getSelection().removeAllRanges();