title: get index value from getElementsByClassName collection
body: <p>How can I get the index value of getElementsByClassName collection.</p>
  
  <pre><code>function clickSchedule(){
      var t = document.getElementsByClassName("table")    
      for(i=0; i&lt;=t.length; i++)
      {
          t[i].onclick= function() {
  
              // get the index value of the node when clicked something like this
              // alert(t[i].index)
              // already tried alert(t[i]) returning undefined.
              // already tried alert(t.item(i)) returning NULL.
      };
      }
  }
  window.onload = function(){
      clickSchedule();    
  };
  </code></pre>