diff --git a/test.html b/test.html index bd59b07..dd878e7 100644 --- a/test.html +++ b/test.html @@ -21,6 +21,7 @@ const questions = [ ]; let questionnum = 0; +let countInterval = null; function paddedFormat(num) { return num < 10 ? '0' + num : num; @@ -31,7 +32,8 @@ function startCountDown(duration, element) { let min = 0; let sec = 0; - let countInterval = setInterval(function() { + clearInterval(countInterval); + countInterval = setInterval(function() { min = parseInt(secondsRemaining / 60); sec = parseInt(secondsRemaining % 60);