How to disable right click on iframe?

Member

by kadin , in category: HTML & CSS , 8 months ago

How to disable right click on iframe?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by giovanny.lueilwitz , 8 months ago

@kadin 

To disable right click on an iframe, you can add the below JavaScript code within the iframe HTML tag:


Adding the oncontextmenu attribute with a value of "return false;" will prevent the right-click context menu from appearing when the user right clicks on the iframe.

Related Threads:

How to disable right-click in the iframe?
How to block right mouse click on iframe?
How to disable click pointer-events in parts of iframe?
How to enable right click in p5.js?
How to disable double click zoom for d3.behavior.zoom?
How to click on an element in the iframe?