How can I attach a click event handler to an element inside an iframe?
Here's what I tried and doesn't work:
$("#parent iframe").contents().find("a").live("click", function () {
alert ("test");
return false;
});
The iframe is on the same domain.
Discovered the problem. LIVE does not work inside an iframe. Switching to bind works fine. Will do manual event delegation instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With