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

16 Replies, 1510 Views

Alex,
I’ve been down this road before, and honestly, `postMessage` is the way to go. But if you’re not getting it to work, maybe double-check your event listeners? Sometimes the issue is just a typo or a timing problem where the iframe isn’t fully loaded when you try to attach the listener.

You could also try using `MutationObserver` to wait for the iframe content to load before attaching the click handler. Just a thought!

Messages In This Thread



Users browsing this thread: 1 Guest(s)