In one my previous post, we saw how you can disable selection of text on a webpage which works based on CSS that completely prevent users to select any text from your webpage but why we should do this ? Because, to prevent people to stealing / copying your content. but there are many other ways to copy the content from a webpage even section of text is disabled on your webpage. So, alternately you can use a stronger javascript code which not disable selection of text only, but also it would disable CTRL + U ( Can be used to see actual HTML code, used to create a webpage) , CTRL+C (Can be used to copy highlighted / Selected text) and right mouse click (displays list of options to do something with the item such as view source, copy, paste etc.) on your website / blog.

OK, Let’s move to the tutorial of disabling CTRL+U , CTRL+C key and right click on your website / blog.

In your blog’s HTML, search for </head> tag, Just above it paste below javascript code.

<script type='text/javascript'>
var isCtrl = false;
document.onkeyup=function(e)
{
if(e.which == 17)
isCtrl=false;
}
document.onkeydown=function(e)
{
if(e.which == 17)
isCtrl=true;
if((e.which == 85) || (e.which == 67) &amp;&amp; isCtrl == true)
{
// alert(&#8216;Keyboard shortcuts are cool!&#8217;);
return false;
}
}
var isNS = (navigator.appName == "Netscape") ? 1 : 0;
if(navigator.appName == "Netscape") document.captureEvents(Event.MOUSEDOWN||Event.MOUSEUP);
function mischandler(){
return false;
}
function mousehandler(e){
var myevent = (isNS) ? e : event;
var eventbutton = (isNS) ? myevent.which : myevent.button;
if((eventbutton==2)||(eventbutton==3)) return false;
}
document.oncontextmenu = mischandler;
document.onmousedown = mousehandler;
document.onmouseup = mousehandler;
</script>

Now, Save the changes and You’re done !

Also read : How to Convert HTML and CSS to Unreadable Javascript