I'm using
$(".entry").filter(":odd").addClass('alt');
within $(document).ready()
to facilitate zebra striping of everything with class 'entry'.
In the course of interacting with the page, new DOM elements with class 'entry' are appended one-by-one at the end. I'd like to use something similar to the above to make sure the newly appended entry has the appropriate background color, meaning the opposite color of whatever 'entry' preceded it.
I can't think of an elegant (or really any) way to do this. Any ideas? Is there something analogous to .live()
that would apply this rule to all current and future matches?
UPDATE
edit: moved update to answer