To disable the right click on the webpage?

Hi friends,

After working hard to complete your  design and images  ,some persons just save that images and web pages.

This is one  idea to disable the right click on webpage.

just put a small javascript code at the place between the head section.


<!– Disable
function disableselect(e){
return false

function reEnable(){
return true

//if IE4+
document.onselectstart=new Function (“return false”)
document.oncontextmenu=new Function (“return false”)
//if NS6
if (window.sidebar){


Demo at @

Anil Kumar Panigrahi

With more than 10 years experience in PHP and Founder of Anil Labs, a blog for PHP and related posts. contributed posts regarding CodeIgniter, CakePHP and Learn PHP online ... Contact : [email protected]

You may also like...

4 Responses

  1. Nice tip anil.. Are you interested to write an artilce on my blog..

    Just togeather all your old post. Sure your blog traffic increase through my blog

  2. Sumeet says:

    Thanx champ, Thanx a lot for all your good work. Keep Posting.

  3. Pradnya says:

    Good, but to inspect the page we can use ctrl+shift+i also. Is there any solution to disable this also?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.