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

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

In this post we will give you information about How to disable right click on div using context menu jquery?. Hear we will give you detail about How to disable right click on div using context menu jquery?And how to use it also give you demo for it if it is necessary.

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.

Example:

<html lang="en">

<head>

<title>Jquery - disable right click on div using context menu </title>

<script src="http://demo.onlinecode/plugin/jquery.js"></script>

</head>

<body>


<div >

<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>

So, let’s check…..

Hope this code and post will helped you for implement How to disable right click on div using context menu jquery?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

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

  +  68  =  73

We accept paid advance and paid guest Posting on our Site : Contact US