From c8148bdb15b1d18a26f7eecb0e37b6c039f87dd9 Mon Sep 17 00:00:00 2001 From: mmaster Date: Sat, 20 Apr 2024 05:08:05 +0200 Subject: [PATCH] test.html aktualisiert fix counter --- test.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);