timer in javascript | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

timer in javascript

Hello everybody i have create an html page that containt two div with two table and each 5 senconds table toggle and the whole page is refreshed in 2 minutes with this ////////////: setInterval(function(){ location.reload(); }, 120000); ///////////////////////////////////////// i want to create a timer that show me the time before refresh .

8th Feb 2019, 3:03 PM
ABDELMOUGHIT GARDAM
ABDELMOUGHIT GARDAM  - avatar
1 Answer
+ 2
Using a function show that shows on the page the content given as parameter let x = 1; setInterval(function() { show(120000 - x*1000); x++; }, 1000);
8th Feb 2019, 4:20 PM
Αητοιπe
Αητοιπe - avatar