Javascript language

adplus-dvertising
Disabling Right Click button of mouse
Previous Home Next

How to Disabling Right Click button of mouse using JavaScript

Step 1. Written below code in your application.

<html>
<head>
<script language="JavaScript">
function disable()
{
if (event.button == 2)
{
alert("Sorry no rightclick on this page.\nNow you can not view my source\n
and you can not steal my images")
}
}
</script>
</head>
<body onmousedown="disable()">
<form>
<a href="#">Good Morning!!!!</a>
<p>Have a Nice Day!!!</p>
<p>Have a great Day!!!</p>
<img src=Image.jpg />
</form>
</body>
</html>

Step 2. Run the Application.

Previous Home Next