I am trying to change the class of an dynamic element that I cannot directly access in code. I can access its parent so I've been targeting it like so: .menu > div. That div has a class of "col-xs-12 col-sm-4 col-md-3 col-lg-2". I want to be able to change the class of .menu > div to class "new-menu"
I don't quite get how I can do that. Would I use getElementsByClassName somehow? How can I access that specific div? It has to be targeted because there are other elements with "col-xs-12 col-sm-4 col-md-3 col-lg-2" but with different parent classes.
This code is from a dynamic menu that uses the same code to generate submenus so it's a bit confusing to target the submenu that I want.