I working on something where I need two functions.
1 – I need to look at a group of children under the same parent and based on a class name, “active”, add that element’s ID to an array.
['foo-a','foo-b','foo-d']
2 – I then iterate through all the children in another parent and for each element I want to find out if it has any class name that match the ids in the array.
Does this element have class foo-a, foo-b or foo-d?
1 Answer