Pomodoro Clock_Help Requested_Reset Button

Hello. I wondered if I could get some help. I’m unsure of how to reset the timer. I’ve got the start and stop buttons down. Just not sure how to approach this problem. Thanks.

Try something like this:

  $('#reset').on('click', function() {
    counter = 0;
    timeLeft = 25*60;

Thanks! Something unusual happens if I click on start more than once in a row. The timer speeds up and then I cannot stop or reset it. Can I code in instructions that say one cannot click on the button more than once in a row?


Just write this:

    time = setInterval(timeIt, 1000);

Otherwise you’re setting a new interval each time.

Thanks! Works great now.

1 Like