Join WhatsApp ChannelJoin Now

Disable right click menu using jQuery Example

This post was last updated on January 1st, 2025 at 06:38 am

Hi Dev,

Today, we will show you disable right click menu using jQuery example. This article will give you simple example of disable right click menu using jQuery example. Let’s discuss disable right click menu using jQuery example. In this article, we will implement a disable right click menu using jQuery example.

So let’s follow few step to create example of disable right click menu using jQuery example.

Example

<html lang="en">
<head>
  <title>Jquery - disable right click on div using context menu </title>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
</head>
<body>


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


<script type="text/javascript">
	$(document).ready(function() {
	    $(".my-div").on("contextmenu",function(){
	       return false;
	    }); 
	});
</script>


</body>
</html>

I hope it will assist you…

Recommended Posts