What\'s the best way to make an element unselectable using jQuery?
I know you can use onselectstart=\"return false;\" ondragstart=\"return false;\" in the H
onselectstart=\"return false;\" ondragstart=\"return false;\"
I believe this is a better answer.
$('*[data-noselect="true"]').focus( function () { $(this).blur(); }); $('*[data-noselect="true"] *').focus( function () { $(this).blur(); });
Then you can just add a data-noselect="true" to any element.
data-noselect="true"