javascript disable right click

41

how to disable right click in javascript -

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

javascript disable right click -

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

// ⇓ Test it (fiddle) ⇓

disable right click javascript -

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

Comments

Submit
0 Comments