title: Add Event Listener to Collection of HTML Elements
body: <p>I know that <code>getElementsByTagName</code> and <code>getElementsByClassName</code> need an index identifier in order for the objects to be bound to an event listener. </p>
  
  <p>So the question is, <strong>how do I add an event listener to a collection of HTML elements found using</strong> <code>getElementsByTagName</code> <strong>or</strong> <code>getElementsByClassName</code><strong>?</strong></p>
  
  <pre><code>&lt;input class="inputs" type="submit" value="Hello" /&gt;
  &lt;input class="inputs" type="submit" value="World" /&gt;
  
  var inputElem = document.getElementsByTagName('input');
  inputElem.addEventListener('click', function(){
      alert(this.value);
  }, false);
  </code></pre>
  
  <p>I know how to do this in jQuery, but I want to know how to do it with pure JS.</p>