Ciao.
Prova qualcosa del genere:
codice:
var sel = window.getSelection ? window.getSelection() : document.selection;
if (sel) {
    if (sel.removeAllRanges) {
        sel.removeAllRanges();
    } else if (sel.empty) {
        sel.empty();
    }
}
fonte: http://stackoverflow.com/questions/3...ith-javascript