title: Get index of the Clicked item in YUI
body: <p>I have the following code.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;ul&gt;
      &lt;li class="link"&gt; link 1 &lt;/li&gt;
      &lt;li class="link"&gt; link 2 &lt;/li&gt;
      &lt;li class="link"&gt; link 3 &lt;/li&gt;
      &lt;li class="link"&gt; link 4 &lt;/li&gt;
  &lt;/ul&gt;\
  </code></pre>
  
  <p><strong>javaScript</strong></p>
  
  <pre><code> YUI().use("node", function(Y){
  
      Y.all(".link").on("click", function(em){
         alert("you clicked on "+ index +"link .");
         node = em.currentTarget;
         node.addClass("clicked");
         // alert(node.get("class"));
      });
       alert(Y.all("li").get("class"));
  });
  </code></pre>
  
  <p>I have two queries on this.</p>
  
  <p>1) While first alert it should show class name "link" but it give alert of some YUI_23123_ random number. Why so?</p>
  
  <p>2) And I want to alert the index also. example when user click on third link it should alert "you clicked on 3 link" and I also want to use this index value in other event as well.</p>
  
  <p>How we can achieve the index?</p>
  
  <p><a href="http://jsfiddle.net/v9Zkd/2/" rel="nofollow">JSFiddle link</a></p>