How to prevent selecting text on double click?

css, double-click, html, text

Solution

try little jquery

 $(element).mousedown(function(){ return false; })

with css try

-webkit-user-select: none;
-moz-user-select: none;
-khtml-user-select: none;
-ms-user-select: none;

Problem

``` #btnLeft{ width:40px; padding:2px 5px 2px 5px; background-color: #20a0a0; border: thin solid #099; border-radius:7px; text-align:center; font-family:"Futura Md BT"; font-size:large; color:#FFF; } ``` This is a css button. When user accidentally makes double click instead of single one, text inside the button becomes selected, i.e. - changes its background color. How to prevent this selecting on double click ?

Original source

Related problems