How to disable right click on iframe?

Member

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

How to disable right click on iframe?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by giovanny.lueilwitz , 3 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.