Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Notice that if you click on a square that is taken by the other player, the marker may turn into a question mark. This is
Notice that if you click on a square that is taken by the other player, the marker may turn into a question mark. This is because you have added both X-marker and O-marker classes to the document. If you used className instead of classList you would be able to take over another players square. Also, if you click on your own square you wasted your turn. Modify the event handler to check to see if there is a class on the element already. (Hint: this is a good use of className but there are other ways to do it.) Dont put a marker or count the turn if the square is already taken.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started