Odd and even in jQuery

Odd and even in jQuery


I didn’t really get the difference between even and odd here. If odd is even in jQuery and even is even too, what’s odd?


Well… this is odd. But :odd selects second element (index 1), fourth element (index 3) and so on. :even selects first (index 0) element, third element (index 2) and so on. So the way it is stated, is slightly complicated. But in this case you should just use :even.