How to Detect a Click from an Iframe for a Specific Div? Need Help!

16 Replies, 1499 Views

Hey everyone,

So I’ve been stuck on this issue for a while now and could really use some help. I’m trying to *detect a click from iframe for specific div* on my page. Basically, there’s an iframe embedded, and I need to know when someone clicks inside it, but only if they click on a particular div within that iframe.

I’ve tried a few things like `postMessage` and event listeners, but I’m not sure if I’m doing it right. The iframe is from the same domain, so no cross-origin issues, but still, it’s driving me nuts lol.

Anyone got a working example or some tips on how to *detect a click from iframe for specific div*? Would really appreciate it!

Thanks in advance!
- Alex

Messages In This Thread
How to Detect a Click from an Iframe for a Specific Div? Need Help! - by - 01-09-2024, 03:50 AM



Users browsing this thread: 1 Guest(s)