How to disable right click on div using context menu jquery?

By Hardik Savani | August 8, 2016 | | 15124 Viewer | Category : Javascript jQuery

Today, i am going to tell you how to disable mouse right click on div. this example thought you can learn how to disable right click on page or image or any html tag.

jquery provide contextmenu event that way we can prevent right click on specific html element. In this example i used contextmenu event with on().

So, let's see example code and check demo.


<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:red"></div>


<script type="text/javascript">

$(document).ready(function() {


return false;






So, let's check.....

Please Subscribe Your Email Address, We Will Notify When Add New Post:

We are Recommending you: