How to disable text selection in your Blog or website.. Disable the copy paste ..


In one of our previous posts, we presented a tutorial that shows you how you can disable the right-click function as a means to prevent (but not completely prevent) the contents of copiers without your consent.



disable text selection in Blogger

Here is another added measure you can use to make it even more difficult task for them. This technique is to disable text selection. The application of this technique on your Blogger blog is simple, just follow these steps: In your dashboard, go to Layout, and then click Add a Gadget. Select HTML / JavaScript, Copy and paste this code below:

<script type="text/javascript">
var omitformtags=["input", "textarea", "select"]
         omitformtags=omitformtags.join("|")
 
function disableselect(e){
if (omitformtags.indexOf(e.target.tagName.toLowerCase())==-1)
return false
}
 
function reEnable(){
return true
}
 
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false")
else{
document.onmousedown=disableselect
document.onmouseup=reEnable
}
 
</script>

Then save the widget and you're done.
Go ahead and try to select any text on your page. You will see that you will not be able to show anything, not even the images elsewhere.
Previous
Next Post »