Requirements:
-
Using
setInterval
, create a page that would display the number of seconds the user spent on it. It will start by displaying0
, after 1 second it will replace0
with1
, after another second it will show2
and so on. -
Modify the counter so that it never resets: each time the user visits the page, the initial number of seconds he sees is the number of seconds he has already spent on the page. The timer then increases the number by 1 every second, just as it did before.
Read the guideline before start
Result