If you try to detect or capture a click event inside an iframe simply using jQuery click() method it will not work, because iframe embed a web page within another web page. However, you can still do it on the same domain utilizing the jQuery contents() and load() method.
The following example will display an alert message whenever you click inside the iframe.
Use the jQuery
contents()methodIf you try to detect or capture a click event inside an iframe simply using jQuery
click()method it will not work, because iframe embed a web page within another web page. However, you can still do it on the same domain utilizing the jQuerycontents()andload()method.The following example will display an alert message whenever you click inside the iframe.
need an explanation for this answer? contact us directly to get an explanation for this answer