How to Disable Right Click Menu using JQuery with Example

Posted by


Have you ever wondered how to prevent users from right-clicking on your website? In this article, we will explore the use of JQuery to disable the right-click menu. With a few lines of code, you can protect your content and enhance the user experience.

Why Disable Right Click?

Disabling the right-click menu can be useful in various scenarios. It can prevent users from copying your images, downloading your content, or accessing certain functionalities. By disabling the right-click menu, you have more control over how users interact with your website.

Getting Started

To disable the right-click menu using JQuery, you need to follow these steps:

Step:- Create HTML page

<html lang="en">
  <title>Jquery - disable right click on div using context menu </title>
  <script src=""></script>

<div class="container">
	<div class="my-div" style="width:500px;height:500px;background:blue"></div>

<script type="text/javascript">
	$(document).ready(function() {
	       return false;


On the container right-click not working.

Hopefully, It will help you..!!!

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x