Making an element unselectable using jQuery

前端 未结 4 862
滥情空心
滥情空心 2021-02-10 09:48

What\'s the best way to make an element unselectable using jQuery?

I know you can use onselectstart=\"return false;\" ondragstart=\"return false;\" in the H

4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-10 10:14

    I think jQuery will abstract the browser variance & so it will help you make HTML elements unselectable.

    Having said that, please note that the client can decide to switch off javascript, in which case you need to ensure that he still cannot do anything that will cause harm...

    HTH.

提交回复
热议问题