-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
20 lines (16 loc) · 835 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// // Function to display the saved times from Local Storage as a scoreboard
// function displayScoreboard() {
// // Retrieve the saved times from Local Storage
// let elapsedTimes = JSON.parse(localStorage.getItem("elapsedTimes") || "[]");
// // Get a reference to the scoreboard div
// let scoreboardDiv = document.getElementById("scoreboard");
// scoreboardDiv.innerHTML = ""; // Clear any previous entries
// // Loop through each saved time and display it on the scoreboard
// elapsedTimes.forEach((entry) => {
// let entryDiv = document.createElement("div");
// entryDiv.innerHTML = `${entry.date} - ${entry.time}`;
// scoreboardDiv.appendChild(entryDiv);
// });
// }
// // Call the displayScoreboard function to show the saved times when the page loads
// displayScoreboard();