I\'m trying to attach an eventlistener to the \"click\" event of a button on a page in an IFrame. The page in the iframe belongs to the same domain as the parent window.
Using jQuery:
$("#iframe_Id").contents("#button_id").click(functionToRun);
Or without jQuery:
document.getElementById("iframe_Id").contentWindow.document.getElementById("button_id").addEventListener("click", functionToRun, false);
This will only work if the iframe meets the same origin policy.