Home Get Index of Span if based on the class available
 My HTML is as below. 
 When I click on the span I want to get the index of span comparing to all other spans having same class , Which means.. Click on before last span I need the index as 4 This is the code I am using to take now. var selector = \$(this); var selectIndex = selector.index();