I have an iframe on my page, and need to get a child element from it whose ID I have. I'd like to do something like this:
document.getElementById('iframeID').getElementById('child element ID')
I'm open to suggestions on how to accomplish this. Unfortunately I don't have access to jQuery or other handy libraries on this page.
You first need to access the iframe document, here is a cross-browser way to do it:
You can then reach the iframe content:
Note: this will only work within a same domain, due to the same origin policy.