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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -