I was making a menu today, and I stumbled on this curious case, with the following HTML:
2 - Here is a Submenu
Then i used the following js:
When I do this the class would only be applied to the outer `
`, but I wanted it to be applied to both the parent and child `LI`s.
Now my question is, how can I handle this "returns" so I apply the classes to both the parent and child `LI`s?
How does js handle these type of selectors? Is the event really running twice and removing the last class that was set? @amnotiam i was merely pointing out my thought process, i removed the point of confusion