If I have the following HTML:
<div id="container">
<iframe></iframe>
</div>
What is the most effective way (mainly in terms of performance) to create a reference to the <iframe> DOM element? I m using something like the following:
var element = document.getElementById( container ).getElementsByTagName( iframe )[0];
IIRC, though, getElementsByTagName can be a slow performer. Is that not an issue since there s only one element within the <div id="container"> anyway?
Is there a more concise, and/or better-performing way to get the <iframe> here? It s safe to say that it will always be the only child of <div id="container">, but not always the only <iframe> on the page.