Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Google is your friend.</p> <pre class="lang-js prettyprint-override"><code>/*********************************************** * Disable Text Selection script- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * This notice MUST stay intact for legal use * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code ***********************************************/ function disableSelection(target) { if (typeof target.onselectstart != "undefined") //IE route target.onselectstart = function() { return false; } else if (typeof target.style.MozUserSelect != "undefined") //Firefox route target.style.MozUserSelect = "none" else //All other route (ie: Opera) target.onmousedown = function() { return false; } target.style.cursor = "default"; } //Sample usages //disableSelection(document.body) //Disable text selection on entire body //disableSelection(document.getElementById("mydiv")) //Disable text selection on element with id="mydiv" </code></pre> <p>Fixed the code above: <a href="http://jsfiddle.net/jUfe4/7/" rel="nofollow">http://jsfiddle.net/jUfe4/7/</a></p> <pre><code>function disableSelection(target) { var ieSelect = typeof target.onselectstart != "undefined"; var ffSelect = typeof target.style.MozUserSelect != "undefined" if (ieSelect) target.onselectstart = function () { return false; }; else if (ffSelect) target.style.MozUserSelect = "none" else target.onmousedown = function () { return false; }; target.style.cursor = "default"; } </code></pre> <ul> <li><a href="http://www.dynamicdrive.com/dynamicindex9/noselect.htm" rel="nofollow">http://www.dynamicdrive.com/dynamicindex9/noselect.htm</a></li> <li><a href="http://www.webdeveloper.com/forum/showthread.php?191294-Disable-ctrl-a-in-Firefox" rel="nofollow">http://www.webdeveloper.com/forum/showthread.php?191294-Disable-ctrl-a-in-Firefox</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload