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
Post a Comment