My brain must be utterly broken, because I can’t figure out why this isn’t simple.
I have two lists– one of categories, and one of items belonging to these categories. I need to highlight items in the second list based on the item selected in the first, using shared classes.
Based on what I can tell, I’m missing a loop on my second list, for starters, but something else is wrong as well. I just can’t figure out the right way to use addClass and hasClass together, maybe.
Here’s a fiddle:
You’re making it too hard, it will work like this:
here is a working fiddle