Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

disable right click jquery

//Disable mouse right click
$("body").on("contextmenu", function(e) {
  return false;
});
Comment

Disable Right Click 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>
Comment

jquery source disable right click

<script type="text/javascript">
$(document).ready(function () {
    //to disable the entire page
    $("body").on("contextmenu",function(e){
        return false;
    });
    
    //to disable a section
    $("#id").on("contextmenu",function(e){
        return false;
    });
});
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: react form on submit 
Javascript :: select a random element from from items array 
Javascript :: converst strig in number in js 
Javascript :: getelementsbyname 
Javascript :: how to use await to console 
Javascript :: js remove zeros after decimal 
Javascript :: open json file in current directory python 
Javascript :: javascript date get minutes with leading zero 
Javascript :: javascript regex escape forward slash 
Javascript :: react material ui media queries 
Javascript :: javascript clear classlist 
Javascript :: jquery get selected text from multiselect 
Javascript :: json parse array local storage 
Javascript :: random array javascript 
Javascript :: react native regenerate android and ios folders 
Javascript :: average of an array js 
Javascript :: ng build staging 
Javascript :: navigation reset 
Javascript :: component did mount in hooks 
Javascript :: run react app in react 18 
Javascript :: how to get last element of array 
Javascript :: object to query string js 
Javascript :: how to count vowels in a string javascript 
Javascript :: display current date and time in react js 
Javascript :: force page to reload on back button 
Javascript :: summation of array elements 
Javascript :: image onclick function react 
Javascript :: style before javascript 
Javascript :: check if a variable is a number in javascript 
Javascript :: image base64 to file javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =