Last updated on January 11th, 2022 at 07:39 pm

VN:F [1.9.22_1171]
Rating: 2.0/10 (1 vote cast)

Disable right click using javascript. Tired of searching and integrating so many complex scripts on your webpage just to disable the right click option?

Then here is a simple method inside the HTML or PHP or what ever page you want this to happen just add this oncontextmenu=”return false;” attribute along with the HTML tag not BODY tag as shown below

In your website code, inside the body tag just replace the regular <html> with the code below

<html oncontextmenu="return false">

Tested in Mozilla FireFox, Google Chrome and Safari

It used to work with the oncontextmenu option inside body tag but not anymore. So use the above code within html tag.

<body oncontextmenu="return false;"> (NOT WORKING)

VN:F [1.9.22_1171]
Rating: 2.0/10 (1 vote cast)

Leave a Reply

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