In the original code, this line appears inside the resetGame function:
boxes.innerText = " ";
The issue here is that boxes is a NodeList, which is like an array of all the elements with the class .box. This NodeList represents all 9 boxes in the Tic-Tac-Toe game. When you try to set boxes.innerText = " ";, you're attempting to change the innerText property of the entire NodeList, which isn't valid. Instead, the text of each individual box is needed to change.
If you assign me, I can loop through each individual box (each element in the NodeList) and set the innerText for each one separately.
In the original code, this line appears inside the resetGame function: boxes.innerText = " "; The issue here is that boxes is a NodeList, which is like an array of all the elements with the class .box. This NodeList represents all 9 boxes in the Tic-Tac-Toe game. When you try to set boxes.innerText = " ";, you're attempting to change the innerText property of the entire NodeList, which isn't valid. Instead, the text of each individual box is needed to change. If you assign me, I can loop through each individual box (each element in the NodeList) and set the innerText for each one separately.