Disable text selection to prevent users from copying your content - Cyber Tweaks

Ads Top

Disable text selection to prevent users from copying your content

Content is free. When you buy through links on my site, I may earn affiliate commission. Learn More.

Prevent user from copying your content easily

You must have felt At some point of time, that you needed to disable text selection on your blog or website to prevent others from copying your content. Disabling Text Selection will prevent others from copying text from your page.

This is just a simple Javascript you need to install on your blog or website.

How to Install This script to your blog or website:


You just need to copy below code snippet and paste it just before </head> tag on your page.

<script type="text/javascript">

/***********************************************
* script by: http://www.cybertweaks.com/ 
***********************************************/

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"
}

disableSelection(document.body)

</script>

you're Done.

No comments:

Powered by Blogger.