title: addEventListener to multiple IDs
body: <p>Having trouble getting the following code to work. Calling swapLevel() directly works fine, but the addEventListener() doesn't seem to be doing anything?</p>
  
  <p>JavaScript:</p>
  
  <pre><code>&lt;script&gt;
  function load() {
      var arr = document.getElementById('menu').getElementsByClassName('level');
  
      for (var i=0; i&lt;arr.length; i++) {
          arr[i].addEventListener('click', function(){swapLevel(i);}, false);
      }
      // automatically open the first level
      swapLevel(0);
  }
  document.addEventListener('DOMContentLoaded', load, false);
  &lt;/script&gt; 
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="menu"&gt; 
  &lt;a href="#" class="level"&gt;Level One&lt;/a&gt; 
  &lt;span class="hidden" id="0"&gt;
  &lt;p&gt;Some options here&lt;/p&gt; 
  &lt;/span&gt; 
  &lt;a href="#" class="level"&gt;Level Two&lt;/a&gt; 
  &lt;span class="hidden" id="1"&gt;
  &lt;p&gt;More options&lt;/p&gt; 
  &lt;/span&gt; 
  &lt;a href="#" class="level"&gt;Level Three&lt;/a&gt; 
  &lt;span class="hidden" id="2"&gt;
  &lt;p&gt;Even more options&lt;/p&gt; 
  &lt;/span&gt; 
  &lt;/div&gt;
  </code></pre>