Hi I have a series of tags with different classes. When a span is clicked I want to return the index of the class of spans. So not the index of the spans themselves.
He
Try,
$( "span" ).click(function() { var index = $('.' + $(this).attr('class')).index($(this)); alert(index + 1); });
Try this:
var index = $(this).parent().find($(this)).index();