I have following code where commentTable is the class. It works fine for current comments displayed on the page.
$(".commentTable:odd").addClass("commentTableClass1"); $(".commentTable:even").addClass("commentTableClass2");
but what I really want is that this addition of class be 'live' even when new comments are added. I don't want to remove class and re-add them to get the effect. I just want to apply to new innerHTML the "correct" class.
I could keep count of number of comments and apply different class but I wanted something elegant.