DOM: Disable Right Click

By Xah Lee. Date: .

Here's how to disable right click.

document.addEventListener ('contextmenu', e => e.preventDefault(), false);
βˆ‘ JS in Depth
XAH Β BUY NOW

JS in Depth

JS Obj Ref

DOM


DOM

Overview

Basic Examples

HTML Input

Web Scripting Examples

Web Scripting Misc

jQuery

node.js