Skip to content Skip to sidebar Skip to footer

Disable Text Selection Of Html Element

I'm using the jQuery UI function .disableSelection() to disable text selection. While it works fine for
elements, I can't get it to work for elements. Any

Solution 1:

Assuming you are looking to stop text selecting rather than disable an element, you can modify your code slightly to achieve this. Live example: http://jsfiddle.net/7SfBx/2/

$('.test').disableSelection().css('webkit-user-select','none');

Solution 2:

$(".test").attr("disabled", true);

Post a Comment for "Disable Text Selection Of Html Element"