Learn how to disable right click with JavaScript


0

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>

Like it? Share with your friends!

0

What's Your Reaction?

hate hate
0
hate
confused confused
0
confused
fail fail
0
fail
fun fun
0
fun
geeky geeky
0
geeky
love love
0
love
lol lol
0
lol
omg omg
0
omg
win win
0
win
Anand Narayanaswamy
Anand Narayanaswamy is the editor-in-chief of Learnxpress. He was a Microsoft Most Valuable Professional (MVP) for a period of 9 years. He is a ASPInsider based in Trivandrum, Kerala State, India. Anand is the author of Community Server Quickly published by Packt Publishing.

4 Comments

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

  1. Excellent read, I just passed this onto a colleague who was doing some research on that. And he just bought me lunch since I found it for him smile Therefore let me rephrase that: Thank you for lunch!

  2. Hey there, You’ve done an admirable job. I should surely digg it and I’ll recommend to my buddies. Most likely they’ll be taken advantage of this great site.