Tic Tac Toe javascript. How to store player wins and to alert if there is a tie? - Stack Overflow

PHOTO EMBED

Sat Aug 13 2022 13:06:44 GMT+0000 (UTC)

Saved by @JuanUO #javascript #html

<html>
<title>Tic Tac Toe</title>
<head>
  <link rel="stylesheet" type="text/css" href="css/style.css" />
  <script type="text/javascript" src="js/app.js"></script>
</head>
<body onload="startGame();">
  <h1>Tic Tac Toe</h1>
  <h2>By Irsyad</h2>
  <div id ="message"><h3> messages will go here<h3></div>
  <div>
    <a href="javascript:startGame();">Restart</a>
  </div>
  <table>
    <tr>
      <td id="s1" class="square" onclick="nextMove(this);"></td>
      <td id="s2" class="square" onclick="nextMove(this);"></td>
      <td id="s3" class="square" onclick="nextMove(this);"></td>
    </tr>
    <tr>
      <td id="s4" class="square" onclick="nextMove(this);"></td>
      <td id="s5" class="square" onclick="nextMove(this);"></td>
      <td id="s6" class="square" onclick="nextMove(this);"></td>
    </tr>
    <tr>
      <td id="s7" class="square" onclick="nextMove(this);"></td>
      <td id="s8" class="square" onclick="nextMove(this);"></td>
      <td id="s9" class="square" onclick="nextMove(this);"></td>
    </tr>
  </table>
</body>
</html>
content_copyCOPY

https://stackoverflow.com/questions/39066989/tic-tac-toe-javascript-how-to-store-player-wins-and-to-alert-if-there-is-a-tie