-9

I need to set a countdown timer. The time remaining in the format of "00:00:00".

I need to create a countdown timer displaying minutes and seconds within four <span></span> elements.

For example, when I have 56 minutes and 45 secs, its value should be set as follows:

5-with in one span element
6-with in second span element
4-with in third span element
5-with in last span element

or

<span>5</span><span>6</span><span>4</span><span>5</span>
1

1 Answer 1

1

This will get you started and push you in the right direction. The rest is up to you.

var start = 5;

function countdown() {
    $("#spanId").html(start--);
    if (start)
       setTimeout(countdown, 1000);
}
countdown();
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.