Skip to content

All topics  /  jQuery

How to disable right click using jQuery?

jQuery ·

When “How to disable right click using jQuery?” moves through design, development and browser testing, the official article can clarify hand-offs and time spent on revisions while leaving code quality, accessibility and released behaviour as the real measures of success.

For API changes, browser support and current usage patterns, compare the snippet with the official jQuery website before adopting it in production.

Hii guys,

In this artical, i will give you example of disable right click jquery on div. If You are looking for a simple way to disable right click for any html element then here you will find the best solution to disable right click on page.

There are some reasons why you will disable the right click of mouse button.

It may be you want to show your own menu html page right click disable on a , useing the jQuery bind() method.

Example

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<h3>Right click is disabled on this page.</h3>
<script>
$(document).ready(function(){
     $(document).bind("contextmenu",function(e){
     	 alert('right click disabled');
        return false;
    });
});
</script>
</body>
</html>

It will help you...

# Jquery