Using only CSS, you can use user-select like this:
-moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none;
This works in Firefox, Chrome and Safari, IE10 and higher, but not in Opera.
This simply stops the user selecting the text, but this will prevent them from being copied. This is good for button text.
In older IE and Opera, you can establish that it is not selectable using:
var elem = document.getElementById("yourElement"); elem.unselectable = "on";
in JS or just add an unselectable
attribute and set it to turn it on.
Here is an example: http://jsfiddle.net/B9yYt/
source share