Learn how to disable right click with JavaScript


Do you want your visitors not to right click on the page they visits? If yes then check out the snippet given in this article.

<html>
<head>
<script language = "javascript">
function Disable() {
if (event.button == 2) 
{
alert("This action is not possible")
}
}
document.onmousedown=Disable;
</script>
</head>
<body>
</body>
</html>
Exit mobile version
Skip to toolbar