Start button won't respond when clicked

Tell us what’s happening:
Describe your issue in detail here.

I’m currently building a stopwatch but the buttons aren’t working, I wish I knew where or what the problem is so I can direct you to it :frowning:

I thought the problem was me using the wrong class and/or id name, unfortunately that doesn’t seem like the problem. (or I could be wrong)

This is my first time building a project, so maybe I’m missing something very obvious in my code.

Any help would be appreciated!

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Basic Algorithm Scripting - Where do I Belong

Link to the challenge:


Thank you for responding! I did what you told me, the console said my seconds wasn’t declared in my timer function (as well as minutes and hours), so I declared them inside the function timer.

The stopwatch started counting seconds but only up to 1 second, then it stopped incrementing, the console doesn’t report any errors either.

I can’t figure out the problem because the stopwatch did count to 1 second, which means the start button worked, and the timer function worked as well. I thought maybe the ++ was the problem because perhaps it only incremented once, not continuously, but I checked some online tutorials they used seconds++ too.

Oh, is it because every second the function timer gets executed it declares seconds to 0 (since I declared seconds = 0 inside the function), therefore increments seconds from 0 to 1 forever?

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.