I'm trying to get the index of the trigger element in the array.
The html looks like this:
<ul>
<li><a href="#" rel="group">Link 1</a></li>
<li><a href="#" rel="group">Link 2</a></li>
<li><a href="#" rel="group">Link 3</a></li>
</ul>
Then on click I'm calling the run() method of the obJ object:
var obJ = {
run : function(obj) {
var att = obj.attr('rel');
var arr = jQuery.find('a[rel='+att+']');
alert(obj.indexOf(arr));
}
};
$(function() {
$('a.click').click(function() {
obJ.run($(this));
return false;
});
});
The above however doesn't give me the index of the trigger in the collected array.
Any thoughts?