How to invoke a function in iframe using JS or how to even target the iframe? I've tried using document.getElementByID("myIframe"), but it didn't seem to work. Below is a basic form of the HTML:
<html>
<head>
<script>
function runFunction() {
var win = document.getElementByID("myIframe");
}
</script>
</head>
<body onload="runFunction()">
<iframe id="myIframe" name="myIframe" src="http://www.myothersite.com/"></iframe>
</body>
</html>
My other site has a function named getEvents() that I would like to somehow invoke. Any help would be greatly appreciated.
console.log(win), you are getting nothing?