JavaScript getAttribute not working
<pre><code>var objects = document.getElementsByTagName('object');
for (var i=0, n=objects.length;i&lt;n;i++) {
    objects[i].style.display='none';
    var swfurl;
    var j=0;
    while (objects[i].childNodes[j]) {
    if (objects[i].childNodes[j].getAttribute('name') == 'movie') {
            /* DO SOMETHING */ 
    }
    j++;
}
    var newelem = document.createElement('div');
    newelem.id = '678297901246983476'+i;
    objects[i].parentNode.insertBefore(newelem, objects[i]);
    new Gordon.Movie(swfurl, {id: '678297901246983476'+i, width: 500, height: 400});
}
</code></pre>

<p>It says that getAttribute is not a function of childNodes[j]. What's wrong? I don't see the point.</p>
