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 :: settimeout 
Javascript :: (node:2736) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead. 
Javascript :: javascript sort object by key 
Javascript :: fetchData from json file 
Javascript :: unpack list javascript 
Javascript :: Clear Cell Value In Google Sheet By App Scripts 
Javascript :: printf statement in javascript 
Javascript :: jquery checkbox checked or not 
Javascript :: angular convert response to json 
Javascript :: javascript random sort array 
Javascript :: last position of array javascript 
Javascript :: js create timestamp with 10 digits 
Javascript :: function use for placing bet 
Javascript :: convert csv to json powershell code 
Javascript :: convert iso 8601 to utc javascript 
Javascript :: javascript add new line in string 
Javascript :: javascript order array by date 
Javascript :: how to copy text in js 
Javascript :: formdata to json 
Javascript :: how to check whether a string contains a substring in typescript online 
Javascript :: javascript console output 
Javascript :: make keystore 
Javascript :: FileReader get filename 
Javascript :: nodemailer custom font 
Javascript :: how to clear js var 
Javascript :: javascript infinity loop 
Javascript :: today in moment 
Javascript :: scroll by javascript 
Javascript :: js domtokenlist to array 
Javascript :: angular new formcontrol default value 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =