Skip to content
Advertisement

Another stopwatch using JS?

The code is creating a responsive page. But every time I press stop and then start again the countdown speeds up. Seconds pass like milliseconds and mins pass like seconds after about 10 or so stops and starts. What might be the issue here? P.S. I haven’t written code for the reset button.

JavaScript
JavaScript

Advertisement

Answer

You have declared setIntID as a local variable in click for the start button, and therefore it isn’t cleared in the click function for the stopbutton.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement