I don't know much about the jquery loops (each?) so wondered if someone could point me in the right direction for the following, which I think is possible...
I have say 10 divs on a page, all divs have a class of post. Then within the class list, they'll also have a number of other classes, some of which denote which category or categories that post is in eg. category-x, category-y and category-z.
I want to be able to say, loop through all posts on the page and hide posts in category-y and category-z but not if they're in category-x.
Eg.
post 1 is in x and y (so stays showing)
post 2 is in y and z (so hides)
post 3 is in x (so stays)
post 4 is in z (so hides)
post 5 is in x, y and z (so stays)
etc.
Thing is, I only know that a post should be in category-x to stay, not that it shouldn't be in y or z. So I need to sort of say 'if there isn't a class matching category-x, then hide'. To (possible) make it more complicated, there won't just be one category to match, there could be x1, x2 and x3, of which a post in any of those categories should stay showing.
Thoughts? Is it possible via jQuery?
TIA
