In this small post i will show you how to disable right click using jquery. Here, we will disable right click on page using jquery. we will use the jQuery bind() method for jquery disable right click. when you don't want your users to download your images at that time you can disble your right click function using jquery.
So, let's see how to prevent right click option using jquery.
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<h3>How to Disable Right Click using jQuery</h3>
<script>
$(document).ready(function(){
$(document).bind("contextmenu",function(e){
alert('right click disabled');
return false;
});
});
</script>
</body>
</html>
You may also like :
In this tutorial, I will guide you through the process of installing the PHP DOM Extension in Ubuntu 23.04. The PHP DOM...
Jan-29-2024
In this article, we will see the file upload with a progress bar in angular 13. In this example, we will learn how to im...
Jun-11-2022
In this article, we will see the laravel 9 vue js crud operation example. Here, we will learn how to create a vue 3...
Dec-07-2022
In this example, we will see how to get the last record in laravel 8. You can simply get the last record using laravel 8...
Jan-26-2022