-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
25 lines (19 loc) · 815 Bytes
/
index.html
File metadata and controls
25 lines (19 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<!DOCTYPE html>
<html>
<body>
<h1>localStorage in JavaScript</h1>
<button onclick="increaseCounter()" type="button">Increase Score</button>
<button onclick="decreaseCounter()" type="button">Decrease Score</button>
<button onclick="clearCounter()" type="button">Clear localStorage</button>
<p>Score:</p>
<p id="score"></p>
<p>Click on the "Increase Score" button to increase the score count</p>
<p>Click on the "Decrease Score" button to decrease the score count</p>
<p>Click on the "Clear localStorage" button to clear the localStorage</p>
<p>
You can close the browser tab (or window), and try again.
You'll see that the data still persits and is not lost even after closing the browser.
</p>
<script src="script.js"> </script>
</body>
</html>