Skip to content

Instantly share code, notes, and snippets.

@raphaelchaib
Created July 23, 2013 17:26
Show Gist options
  • Select an option

  • Save raphaelchaib/6064291 to your computer and use it in GitHub Desktop.

Select an option

Save raphaelchaib/6064291 to your computer and use it in GitHub Desktop.
Disable text selection
function disableselect(e)
{
return false;
}
document.onselectstart=new Function ("return false");
if (window.sidebar){document.onmousedown=disableselect;
document.onclick=reEnable;}
<!-- Disable text selection on Firefox -->
<style type="text/css">
body{
-moz-user-select: none;
-moz-user-focus:ignore;
/*-moz-user-input:disabled;*/
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment