How to set css via jquery for preventing some action -


please refer below link.

how disable text selection highlighting using css?

the above link useful disable selection while dragging. code snippet.

.unselectable {   -moz-user-select: none;   -khtml-user-select: none;   -webkit-user-select: none;   user-select: none; } 

but don't want use css concept here. want set these attributes particular element via jquery. how can ?

thanks,

siva

you can use

("#yourid").css({            -moz-user-select: none;            -khtml-user-select: none;            -webkit-user-select: none;            user-select: none;  }); 

it better use class though

your css class:

.unselectable{        -moz-user-select: none;        -khtml-user-select: none;        -webkit-user-select: none;        user-select: none; } 

your jquery command

$("#yourelementid").addclass('unselectable') 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -