javascript disable right click
snippet in javascript

javascript disable right click

user3481

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

how to disable right click in javascript

user9954

// for disabling right click use this as it is 
document.addEventListener('contextmenu', event => event.preventDefault());
event.preventDefault()