From 48493b39d97ef19f4c1f494946ad7f99fa92c1bb Mon Sep 17 00:00:00 2001 From: Ken Vilar Date: Sun, 3 Dec 2017 17:17:42 +0800 Subject: [PATCH] Remove previous added classes in when new game button clicks on reset function --- main.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.js b/main.js index 093ed64..347fadb 100644 --- a/main.js +++ b/main.js @@ -77,6 +77,14 @@ function reset() { document.getElementById('score-2').textContent = '0'; document.getElementById('current-1').textContent = '0'; document.getElementById('current-2').textContent = '0'; + + document.querySelector('.player-1-panel').classList.remove('winner'); + document.querySelector('.player-2-panel').classList.remove('winner'); + + document.querySelector('.player-1-panel').classList.remove('active'); + document.querySelector('.player-2-panel').classList.remove('active'); + + document.querySelector('.player-' + activePlayer + '-panel').classList.add('active'); }