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

16 Replies, 1511 Views

Hey Alex,
Just wanted to add that if you’re still stuck, you might wanna try using jQuery inside the iframe. It simplifies a lot of the DOM manipulation and event handling. Here’s how you can do it:

```javascript
$('#specificDiv', $('#yourIframe').contents()).click(() => {
console.log('Click detected!');
});
```
It’s not the most modern approach, but it gets the job done. Good luck!

Messages In This Thread



Users browsing this thread: 1 Guest(s)