How to disable mouse right click using jquery
Today, We will discuss how to disable mouse right click using jquery. There are numerous reasons a developer may want to disable right-click on their websites. such as the payment page, images that we use on the web page.
We can below example through disable inspect element using javascript
You can disable the whole page or particular part of the page. here this example, we use to bind the context menu event to disable right-click. see blow following the example of how to disable mouse right click using jquery.
1 2 3 4 5 6 7 8 9 10 11 12 | <script type="text/javascript"> $(document).ready(function() { //Disable whole page $(this).bind("contextmenu", function(e) { e.preventDefault(); }); //Disable particular part of page $("img").on("contextmenu",function(){ return false; }); }); </script> |
Please follow and like us: