How can I deselect text using Javascript or jQuery?

后端 未结 3 1011
孤独总比滥情好
孤独总比滥情好 2021-02-06 23:37

I have a draggable (jQuery UI) element with \"canceled\" text on it. Here\'s what I mean:

$(\'#main\').draggable({
        cancel: \'#main>* *\',
        star         


        
3条回答
  •  耶瑟儿~
    2021-02-07 00:12

    Clear document selection document.selection.empty();

    Something like:

     $('#main').draggable({
         cancel: '#main>* *',
         start: function(){
          // deselect text
          document.selection.empty();
         }
     });
    

提交回复
热议问题