Get order of child selected jquery
I want to make a different background color for child cells depending on their orders, how can I get the order of the children using jquery.
<ul>
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
<li>e</li>
<li>f</li>
</ul>
$('ul li').bind('mouseover', function(e){
//how can I get the order of the childre
//when hover on c it shoul returns 3
alert("child order ");
});
here's an example http://jsfiddle.net/sHefJ/
+3
source to share