/ Published in: JavaScript
Uses jQuery to add a class to odd table rows, for purposes of alternating colors, etc.
Expand |
Embed | Plain Text
$("tr:nth-child(odd)").addClass("odd");
Comments
Subscribe to comments
You need to login to post a comment.

or do it this way: $('tr:odd').addClass('odd'); $('tr:even').addClass('even');