I am trying to solve a problem, where I am not allowed to use ID / CLASS selectors but must use data attributes.
I need to show and hide elements based on the selection from a drop down. The catch is that there are some items that can be shown alongside other elements, and some that are strictly to be shown alone / with specific elements. I have created a Pen to make it easier to understand:
Basically, if the data attribute has ‘OR’ then you can show one element or the other (within the data attribute list).
If the data attribute has ‘AND’ then it must show the selected item AND the other element in the data attribute list.
I hope this makes sense. I am like 80% there, but I know my logic is a bit dodgy and would love to find a cleaner solution! Thanks