title: getElementsByTagName().length returns zero
body: <p>I am trying to do a simple thing such as:</p>
  
  <pre><code>var elements = document.getElementsByTagName("input");
  console.log(elements);
  console.log(elements.length);
  </code></pre>
  
  <p>The console.log(elements) shows the NodeList containing 28 input elements, but the elements.length is always 0. </p>
  
  <p>I've also seen this <a href="https://stackoverflow.com/questions/4179209/getelementsbytagnamediv-length-returns-zero-for-any-webpage">getElementsByTagName(&quot;div&quot;).length returns zero for any webpage</a> however I didn't understand what exactly is the reason for it happening and how to fix it. I've also noticed that this happens on both Firefox, IE, Chrome.</p>
  
  <p>Anyone could help me out?</p>