Seems like I have a similar content class
<div class="parentclass">
<div class="childClass">
</div>
<div class="childClass">
</div>
<div class="childClass">
</div>
</div>
<div class="parentclass">
<div class="childClass">
</div>
<div class="childClass">
</div>
<div class="childClass">
</div>
</div>
I am able to retrieve all parent class objects in an array using the following code:
var pClassList= document.getElementsByClassName("parentclass");
My query is how can I access the child classes "childClass" from pClassList array by specifying their index like this:
var childClassList1= pClassList[0].getElementsByClassName("childClass");
var childClassList2= pClassList[1].getElementsByClassName("childClass");