DEV Community

Discussion on: Create a Stopwatch in JavaScript

Collapse
 
rdrahuldhiman profile image
Rahul Dhiman

Reset Functionality is not fully implemented.

Collapse
 
gspteck profile image
GSPTeck

What do you mean? Reset just makes the string 00:00:00 again. What isn't implemented?

Collapse
 
rdrahuldhiman profile image
Rahul Dhiman

It is just resetting the UI Part but not the actual variables which are still storing the old time values. Below is what i did to get it working.
function resetTimer() {
timer.innerHTML = "00:00:00";
stoptime = true;
hr = 0;
sec = 0;
min = 0;
}

Thread Thread
 
gspteck profile image
GSPTeck

yeah you are right! missed that lol