span tag elements.
querySelectorAll() to get all the elements with
.counter class, then I define two arrays:
count which will allow the code to work.
speeds array will save all the speeds of the elements. The purpose of this, is to use all these speeds variable for summing up the respective
count[pos] varible inside the
setInterval() method, allowing all counters to have their own independent count.
The arrays are filled using the
push() method inside a loop which will iterate through all elements inside the
counters static NodeList.
The first conditional statement will clear the
setInterval() method once the
count variable counter equals 1000, which will cause the count to stop for all the counters.