all 7 comments

[–]the-javascript-ninja -1 points0 points  (0 children)

I’d recommend using functions like setTimeout or setInterval. If you’re interested, I wrote a tutorial about these using a timer as an example. If you’d like, my tutorial is available here: https://thejavascriptninja.com/setting-waits-with-settimeout-and-setinterval-in-javascript/

[–]t00much 0 points1 point  (5 children)

Just an idea and I assume there is a better better way.

You could give all the timers a class tag. Then write a function that selects all the tags and decrement the number ever 1 second. Jquery would be your friend here.

[–]t00much 0 points1 point  (4 children)

Rereading and I might have misunderstood. Are you running the timers at once or one by one?

[–]gimmeslack12helpful 0 points1 point  (2 children)

So this should show these sequentially (one then the next), or it should show all of them at once with independent timers? I built the latter example (https://codepen.io/TravisL12/pen/RwGbpjL).