I created a very small script that creates an alert box saying "YOU CLICKED!" every time a person left clicks on the page, my problem is that i wish for it to occur upon right click too (this is for demonstration/experimentation purposes only). Here is my original script:
<script>
window.onclick=function() {alert("You clicked!");}
</script>
Use oncontextmenu:
window.oncontextmenu = function() {
alert(':)');
return false; /* prevent context menu from popping up */
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With