right click disable javascript code code example
Example 1: javascript disable right click
document.addEventListener('contextmenu', event => event.preventDefault());
Example 2: disable right click javascript
$("body").on("contextmenu", function(e) {
return false;
});
Example 3: how to disable right click in javascript
document.addEventListener('contextmenu', event => event.preventDefault());
event.preventDefault()
Example 4: disable right click javascript
document.addEventListener('contextmenu', event => event.preventDefault());