-
Create a page that would display the number of times the user clicked on it. It will start by displaying
0
, after the first click anywhere on the page it will replace0
with1
, after another click it will show2
and so on. -
Modify the counter so that it does not reset if the user refreshes the page: after each refresh, the initial number of clicks the user sees is the number of times he has already clicked on the page. The counter then increases by 1 upon every click, just as it did before. The counter, however, should reset to
0
after the page is closed and reopened.