Answers for "disable left click on a tag html"

CSS
7

disable right click html w3schools

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

// ⇓ Test it (fiddle) ⇓
Posted by: Guest on September-14-2021
1

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;
});
Posted by: Guest on November-15-2020

Browse Popular Code Answers by Language