title: Javascript getElementsByTagName broken firefox?
body: <p>I'm getting the weirdest issues with Javascript in Firefox today.</p>
  
  <p>I'm trying to manipulate some table rows, but <code>.getElementsByTagName("tr");</code> is pulling back junk.</p>
  
  <pre><code>dynamicTable.tableBody = dynamicTable.getElementsByTagName("tbody")[0];
  var tableRows = dynamicTable.tableBody.getElementsByTagName("TR");
  var actualTableRows = new Array();
  for(var i in tableRows) {
      var row = tableRows[i];
      alert(row.tagName);
      if(row.tagName == "TR"){
         actualTableRows.push(row);
      }
  }
  dynamicTable.bodyRows = actualTableRows;
  </code></pre>
  
  <p>The puzzling part of course is my temporary hack to fix the error. For some reason <code>.getElementsByTagName("tr")</code> is pulling back some functions also.</p>
  
  <p>Incidently, the alert above goes something like this "TR TR TR TR undefined undefined undefined".</p>
  
  <p>The code I wanted was something like this</p>
  
  <pre><code>dynamicTable.bodyRows = dynamicTable.tableBody.getElementsByTagName("tr");
  </code></pre>
  
  <p>But then <code>bodyrows</code> does not contain just <code>&lt;tr&gt;</code> elements, it has the aforementioned junk in it.</p>
  
  <p>Any thoughts?</p>
  
  <p><strong>EDIT:</strong> If I just use the second block of code, I get a list 24 elements long on a table that has 21 table rows (tr elements) . The first block of code is just a hack that fixes the problem.</p>
  
  <p>If I change the alert to <code>alert(row)</code> I get:</p>
  
  <pre><code>[object HTMLTableRowElement]
  ...
  
  function item() {
      [native code]
  }
  
  21
  
  function namedItem() {
      [native code]
  }
  </code></pre>