Rahul Chauhan
By: Rahul Chauhan

Disable right click in html page using jQuery

We can disable or prevent right-click on HTML page using jQuery.

bind() method jQuery

The bind() method attaches one or more event handlers for selected elements and specifies a function to run when the event occurs.

Here we have attached bind() method with current HTML document.


<!DOCTYPE html>




<script type="text/javascript" src="../js/jquery-3.2.1.min.js"></script>



<h1>Disable right click in html page using jquery.</h1>


$(document).bind("contextmenu",function(e) {

return false;





Leave us a comment