Get Latest Tweaks via Facebook, Twitter, Google+ & FeedBurner
    Subscribe Twitter Facebook

    Saturday, December 22, 2012

    Disable text selection to prevent users from copying your content


    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 other 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 in your page.

    <script type="text/javascript">
    * script by: 
    function disableSelection(target){
    if (typeof target.onselectstart!="undefined") //IE route
     target.onselectstart=function(){return false}
    else if (typeof!="undefined") //Firefox route"none"
    else //All other route (ie: Opera)
     target.onmousedown=function(){return false} = "default"

    you're Done.


    Post a Comment