Home / DHTML Tutorial / No right click [IE & Safari only] In DHTML

No right click [IE & Safari only] In DHTML

 
Source code:
 
 
<html>

<head>

<TITLE>[Right Click Disabled]</TITLE>

<script type="text/javascript">

function disable()

{

if (event.button == 2)

{

alert("Right Click not Allowed")

}

}



</script>

</head>

<body onmousedown="disable()">

<p>Right Click not allowed on the page.</p>

<p>.....</p>

</body>

</html>

 
 
Preview of the example on IE.
 
 
Preview on Apple Safari.