-
Selecting Every div inside of a class
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?
-
SitePoint Wizard
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")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks