How do you select the iframe DOM Object on the page if you know the iframe's ID? Assume there might be multiple iframes on the page and you don't know the position of the one in question, and also no jQuery solutions please. I came up with the following, however, I expect it can be much more trivial.
EDIT. I am trying to get the DOM object, so that I can access properties such as window.frames[0].innerHeight
function getIframe(id) {
var iframe=null;
for (var i = window.frames.length - 1; i >= 0; i--) {
if(window.frames[i].frameElement.id==id){iframe=window.frames[i];break;}
}
return iframe;
}