From eab0bc5f3c165da3e51d42acfc0b6219943cb1c6 Mon Sep 17 00:00:00 2001 From: Roshan Bhagtani Date: Sun, 26 Oct 2025 00:32:53 +0530 Subject: [PATCH] feat: Add reset score button to Whack A Mole --- 03 - CSS Variables/index-START.html | 207 +++++++++++++++++++++++----- 1 file changed, 175 insertions(+), 32 deletions(-) diff --git a/03 - CSS Variables/index-START.html b/03 - CSS Variables/index-START.html index d5fcc3a2ae..dd446878d1 100644 --- a/03 - CSS Variables/index-START.html +++ b/03 - CSS Variables/index-START.html @@ -2,51 +2,194 @@ - Scoped CSS Variables and JS + Whack A Mole! + + -

Update CSS Variables with JS

-
- - +

Whack-a-mole! 0

+ + - - - - - +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- + + + + // 6. JS: ADD EVENT LISTENER FOR RESET BUTTON + resetScoreBtn.addEventListener('click', () => { + score = 0; // Reset score variable + scoreBoard.textContent = score; // Update display + localStorage.removeItem('whackAMoleScore'); // Remove score from storage + }); + - + \ No newline at end of file