daviddarx daviddarx - 2 years ago 90
HTML Question

How do I disable text selection with CSS or JavaScript?

Possible Duplicate:

CSS rule to disable text selection highlighting

I am making a HTML/CSS/jQuery gallery, with several pages.

I indeed have a "next" button, which is a simple link with a jQuery click listener.

The problem is that if the user click the button several times, the text of the button is selected, and then the full line of text. In my really darky design, that is really ugly and nonsensical.

So here is my question: Can you disable text selection on HTML?
If not, I'll terribly miss flash and its high level of configuration on textfields...

Answer Source
 style="-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;-o-user-select:none;" 
 onselectstart="return false;" 
 onmousedown="return false;">
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download