You can fetch the parent class by adding the line below. If you had an id, it would be easier with getElementById
. Nonetheless,
var parentNode = document.getElementsByClassName("progress__container")[0];
Then you can use querySelectorAll
on the parent <div>
to fetch all matching div
s with class .progress__marker
var progressNodes = progressContainer.querySelectorAll('.progress__marker');
querySelectorAll
will fetch every div
with the class of progress__marker