Any way to prevent “deselection” of highlighted text?

前端 未结 6 912
南旧
南旧 2020-12-10 13:54

Highlight some text on this webpage, then click basically anywhere on the document. Your selection will disappear.

Is there a way to prevent this behavior when the

6条回答
  •  清歌不尽
    2020-12-10 14:18

    What about

    if(e.preventDefault) 
        e.preventDefault();
    else
        e.returnValue = false;
    

提交回复
热议问题