DOM: Disable Right Click

By Xah Lee. Date: .

Here is how to disable right click.

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

JS in Depth

JS Obj Reference

DOM


DOM

Overview

Basic Examples

HTML Input

Web Scripting Examples

Web Scripting Misc

jQuery

node.js