Event oncontextmenu
Description
The oncontextmenu event occurs when the user right-clicks an HTML element to open the context menu.
Example
Prevent the context menu to show:
div.addEventListener("contextmenu", (e) => {e.preventDefault()});
The oncontextmenu event occurs when the user right-clicks an HTML element to open the context menu.
Prevent the context menu to show:
div.addEventListener("contextmenu", (e) => {e.preventDefault()});