I have something like this:
<div class=“someClass”>
<div>text</div>
<div>text</div>
</div>
I want to apply a class to every div within the someClass div
How would I do something like that?
I have something like this:
<div class=“someClass”>
<div>text</div>
<div>text</div>
</div>
I want to apply a class to every div within the someClass div
How would I do something like that?
Gain a reference to the <div class=“someClass”> element. use something like getElementsByClassName()
Then, you can find the descendant divs of that element via
myDivReference.getElementsByTagName(“div”)