Skip to content

Commit

Permalink
Remove previous added classes in when new game button clicks on reset…
Browse files Browse the repository at this point in the history
… function
  • Loading branch information
kenvilar committed Dec 3, 2017
1 parent 6e374b4 commit 48493b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}


Expand Down

0 comments on commit 48493b3

Please sign in to comment.