How to Disable Clicking in an Iframe

By Jin-Wong Lee

An iframe is an HTML element that displays content from an external page. Sometimes, web developers may wish to prevent the user from clicking on an iframe or the contents of an iframe. Typically, clicking on elements is disabled by using Javascript to set the element's "onclick" event to "return false." Unfortunately, there is no onclick event for iframe elements. However, clicking can still be disabled by placing an invisible blocking overlay over the iframe.

Step 1

Type the code

above your
below your iframe tag.

References & Resources