cancel contextmenu js code example Example: javascript prevent context menu document.addEventListener('contextmenu', event => event.preventDefault());