Skip to content

Commit 1a9f958

Browse files
committed
create startgame function
1 parent e28bcf6 commit 1a9f958

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

public/js/script.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
const cells = document.querySelectorAll('.cell');
3+
startGame();
4+
5+
function startGame() {
6+
document.querySelector(".endgame").style.display = "none";
7+
origBoard = Array.from(Array(9).keys());
8+
for (var i = 0; i < cells.length; i++) {
9+
cells[i].innerText = '';
10+
cells[i].style.removeProperty('background-color');
11+
cells[i].addEventListener('click', turnClick, false);
12+
}
13+
}

0 commit comments

Comments
 (0)