$("span.ws_label").click(function() {
})
By selector "span.ws_label" there are 5 elements selected,
when one of them is clicked,
how to know which one actually?
EDIT
I must get the index or its id,$(this) is no use to me.
$("span.ws_label").click(function() {
})
By selector "span.ws_label" there are 5 elements selected,
when one of them is clicked,
how to know which one actually?
EDIT
I must get the index or its id,$(this) is no use to me.
You can use $(this) inside the function. It's not an index number but it does refer to the element being clicked,
This is my trick:
var i = jQuery(this).prevAll().length;
(i
equals the number of sibling nodes before this
node)