title: addEventListener, for(), index. how to use closure?
body: <p>I have this code:</p>
  
  <pre><code>var items = this.llistat.getElementsByTagName('a');
  
  for( var i = 0; i &lt; items.length; i++ ){    
    items[i].addEventListener('click', function(event) {
      alert( i );
    }, items[i]);
  }
  </code></pre>
  
  <p>where the event is listened, but there are <code>3</code> items and the alert allways print <code>3</code> on any of the elements (it doesn't respect the index),</p>
  
  <p>Dosen't <code>items[i]</code> shouldn't do the job as closure?</p>
  
  <p>thanks!</p>