开发者

Is it possible to use disable text selection script on everything exept input tag

开发者 https://www.devze.com 2023-03-11 11:14 出处:网络
I use this script in one of my开发者_开发问答 applicatuions, but now I would like to do everything same way exept disapply this script for all input tags.

I use this script in one of my开发者_开发问答 applicatuions, but now I would like to do everything same way exept disapply this script for all input tags.

Could anyone say is it possible, ot there is some other solution?


Using only CSS, this should work in most modern browsers (jsfiddle):

* {
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: -moz-none;
    -o-user-select: none;
    user-select: none;
}

input {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -o-user-select: text;
    user-select: text;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消