jQuery odd/even selector bug?

For some reason I have not been able to identify and test, this code would not work (show the same color or same color for subsequent rows, does not seem to have a pattern):

$("#tableid tbody tr:even").addClass("even");
$("#tableid tbody tr:odd").addClass("odd");

But this does work:

$("#tableid tbody tr:nth-child(even)").addClass("even");
$("#tableid tbody tr:nth-child(odd)").addClass("odd");

Any thought?

Comments (0)

› No comments yet.

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Pingbacks (0)

› No pingbacks yet.