I\'m confused as to why .index() is returning 0 in this code. Shouldn\'t it return the index of where it\'s found in the array of jquery objects?
index is always 0 because the is the 1st child in its parent (the ).
index
0
Try getting the 's index instead.
$(this).parent().index()
NOTE: Your HTML isn't valid. The only valid children of s are s.