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 :: one year ago javascript date 
Javascript :: generating component in angular without spec file 
Javascript :: how to use lodash in angular 
Javascript :: installing jQuery in react js 
Javascript :: how to get value and key in a for of loop in js 
Javascript :: get meta content jquery 
Javascript :: joi phone number validation 
Javascript :: javascript confirm yes no 
Javascript :: on keyup jquery 
Javascript :: jquery check if element has css display none 
Javascript :: how to disable ctrl key using javascript 
Javascript :: Javascript get random item from array 
Javascript :: random id js 
Javascript :: javascript change css float property 
Javascript :: parse document.cookie 
Javascript :: remove extra space in string js 
Javascript :: Root composer.json requires tymon/jwt-auth ^0.5.12 - satisfiable by tymon/jwt-auth[0.5.12]. 
Javascript :: uuid react 
Javascript :: javascript get random number in range 
Javascript :: react native animated sticker 
Javascript :: jquery prevent event bubbling 
Javascript :: chart js hide legend 
Javascript :: jquery get data attribute value 
Javascript :: get browser language 
Javascript :: synchronous ajax 
Javascript :: js how to shufle elements in array 
Javascript :: Hide a div on clicking outside it with jquery 
Javascript :: react js usehistory push and pass props 
Javascript :: jquery check if input is empty on submit 
Javascript :: how to raise exception in js 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =