title: Difference between getElementsByClassName and querySelectorAll?
body: <p>From my understanding,</p>
  
  <pre><code>var elems = document.querySelectorAll(".class");
  var elems = document.getElementsByClassName("class");
  </code></pre>
  
  <p>should return the same things. However, when I try to remove the class from all the elements using</p>
  
  <pre><code>for (var i = 0; i &lt; elems.length; ++i)
    elems[i].className = "";
  </code></pre>
  
  <p>I get different results. <code>querySelectorAll</code> successfully removes the classes from all the elements, but <code>getElementsByClassName</code> only removes the classes from about half the elements.</p>
  
  <p>What's going on?</p>