Answers for "how to stop context menu in js"

8

javascript prevent context menu

document.addEventListener('contextmenu', event => event.preventDefault());
Posted by: Guest on March-04-2020
6

javascript disable context menu

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

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

Code answers related to "how to stop context menu in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language