Home Html How to disable right click using jQuery?

How to disable right click using jQuery?

by Shahriar Sagor

Hello Dev’s, Today in this article, i will show you how a example of disable right click using jQuery. Now If You are looking for a short and also a simple way to disable right click for any html element then I hope here you will find the best solution to disable right click on any page.

Now there are some reasons why we need disable the right click of mouse button in our website.

It may be we don’t want to show our own menu html page source code on right click disable on a by using the jQuery bind() method.


<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<h3>Right click is disabled on this page.</h3>

     	 alert('right click disabled');
        return false;

Read Also : How to Get difference between two dates in days using carbon in laravel

Thanks for read. I hope it help you. For more you can follow us on facebook


You may also like