click event and multiple data object
<p>I was wondering how do you get the index of an item that has been click in a collection, e.g a list in <code>ul li</code>?</p>

<p>And how do I access that data in the click event that has multiple tabs? </p>

<p>On the click event below, there is a field for data and I want to get that data corresponding to the index of the clicked item.</p>

<p>How do i do that?</p>

<pre><code>$(this).find('.tabs .tab').on('click', 'a span', { tab: 'Sale-Items', tab: 'All-Items' }, function (e) {
     alert(e.data.tab[0]); // &lt;-- doesn't work
     $(this).unwrap('&lt;a href="#"&gt;&lt;/a&gt;').end()
     $(this).parent().siblings().each(function () {
         $(this).find('span:not(a span)').wrap('&lt;a href="#"&gt;&lt;/a&gt;');
     });
 });
</code></pre>
