Disabling text selection in PhoneGap

stmn picture stmn · Aug 6, 2012 · Viewed 27.8k times · Source

Is it possible to disable text selection to make a PhoneGap app more similar to normal native app?

Something like this:

document.onselectstart = function() {return false;}

or:

* { 
user-select: none;
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
}

Or many other things don't work.

Answer

ThinkingStiff picture ThinkingStiff · Aug 6, 2012

Putting it on html, not *, works for me:

html {
    -webkit-user-select: none;
}