How to Disable Right Click on HTML Page

We can disable the Right Click menu option by using the below Javascript code

<script type="text/javascript">


//Disable right click script

var message="Sorry, right-click has been disabled";

function clickIE() {if (document.all) {;return false;}}

function clickNS(e) {

if(document.layers||(document.getElementById&&!document.all)) {

if (e.which==2||e.which==3) {alert(message);return false;}



if (document.layers){






document.oncontextmenu=new Function("return false")

// -->


Just add the above code for disabling right click

Related Topic How to Enable, Disable Google +1
How to Install Eclipse with Android plugin
How to Disable( Delete ) Facebook Account
Javascript Code for Disabling Mouse Right Click Menu
How to Disable Right Click Javascript without Alert 2011   Privacy Policy  Terms of Service  Feedback