Yo Alex,
I feel your pain lol. Detecting a click from iframe for specific div can be tricky, but since it’s same-domain, you’re in luck. Have you tried using `contentWindow`? You can access the iframe’s DOM directly and attach an event listener to the div.
Something like this:
```javascript
const iframe = document.getElementById('yourIframe');
const iframeDoc = iframe.contentWindow.document;
iframeDoc.getElementById('specificDiv').addEventListener('click', () => {
console.log('Click detected!');
});
```
Let me know if this works for ya!
I feel your pain lol. Detecting a click from iframe for specific div can be tricky, but since it’s same-domain, you’re in luck. Have you tried using `contentWindow`? You can access the iframe’s DOM directly and attach an event listener to the div.
Something like this:
```javascript
const iframe = document.getElementById('yourIframe');
const iframeDoc = iframe.contentWindow.document;
iframeDoc.getElementById('specificDiv').addEventListener('click', () => {
console.log('Click detected!');
});
```
Let me know if this works for ya!
