Prevent onClick event when selecting text

后端 未结 5 1810
星月不相逢
星月不相逢 2020-12-15 16:16

I\'ve got this problem where I need to show and hide divs when clicking on a table cell. However, I also want people to be able to select text and copy it within the cell wi

5条回答
  •  无人及你
    2020-12-15 16:30

    You could check if there is a selection made in the click event handler:

    window.getSelection().toString();
    

提交回复
热议问题