I have a function called userInput that checks if seconds is equal to x, then it gives an alert to the user, and then resets the time. The userInput does not check if seconds is equal to x. Should I use a for loop? Here's my code:
var userInput = function(x) {
if (seconds == x) {
var done = alert("You're done!");
h1.textContent = "00:00:00"
seconds = 0; minutes = 0; hours = 0;
}
}
userInput(x);
And just so you know this, seconds, minutes, and hours are already declared as variables.
Any help is appreciated, thanks.