When I group certain elements together in one container, I like to make odd elements stand out by giving them a different background color. However, when I try to filter elements based on conditions and move unwanted elements to another class, the nth-child selector retains its old state. Even when I try to make it dynamic using jQuery, the issue persists.
I would rather keep both used and unused elements in the same container. If I separate them and change the filters, I would need to re-sort the visible elements again.
Check out my jsfiddle here: http://jsfiddle.net/ex4740n2/5/
Do you have any ideas on how to solve this problem?
Thanks in advance!