Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to disable right click on website

document.addEventListener('contextmenu', event => event.preventDefault());

// ⇓ Test it (fiddle) ⇓
Comment

disable right click div

<div>
    This is the Phone and NO ONE SHOULD RIGHT CLICK THIS! >:) </br>
        <img class="tlClogo" src="http://i.imgur.com/0atiS5C.jpg" style="height: 120px; width:120px;">
    </div></br></br></br></br>
    And this is the Keyboard, ofcourse yo can right click this :)</br>
<img src="http://i.imgur.com/xkrKz1X.jpg" style="height: 120px; width:120px;">

$('img').bind('contextmenu', function(e){
    alert("This Logo is protected");return false;
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to convert string to int js 
Javascript :: how to disable ctrl key using javascript 
Javascript :: js replace quotes 
Javascript :: vscode debug ignore node_modules 
Javascript :: on enter key press react 
Javascript :: react native view background transparency 
Javascript :: E: Unable to locate package nodejs 
Javascript :: js fileinput get content 
Javascript :: npx create-react-app 
Javascript :: parse document.cookie 
Javascript :: javascript how to check for an empty object 
Javascript :: get the first day and last day of current mongth javascript 
Javascript :: javascript get element width and height 
Javascript :: import uuid in react 
Javascript :: validate Alphabet Letter js 
Javascript :: update nodejs 
Javascript :: how to use jquery in chrome dev tools 
Javascript :: base64 encode node js 
Javascript :: ts-node dotenv 
Javascript :: jquery get data attribute value 
Javascript :: python print pretty json 
Javascript :: aws secret manager nodejs javascript 
Javascript :: js get numbers only 
Javascript :: aws s3 cors configuration json example 
Javascript :: jquery each break 
Javascript :: js key is pressed 
Javascript :: CLEAR FORM using jquery 
Javascript :: how to root with any number in js 
Javascript :: ngfor on keys of a dictionary angular 
Javascript :: react native text wrap 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =