Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Javascript, Disable context menu on right click
<!DOCTYPE html>
<title>Javascript, Disable context menu on right click</title>
<script type="text/javascript">
if (document.addEventListener) {
document.addEventListener('contextmenu', function (e) {
}, false);
} else {
document.attachEvent('oncontextmenu', function () {
window.event.returnValue = false;
Copy link

idodidodi commented Jan 24, 2019

It works, thank you.

Copy link

firewood3 commented Oct 11, 2019

Thank you!

Copy link

wavyyy1337 commented Apr 21, 2020

Thank you:)

Copy link

hamzaa53 commented Sep 22, 2020

How can i open back with any button?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment