title: Display JavaScript variable in HTML?
body: <p>I programmed a Tic-Tac-Toe game with HTML and JavaScript and wanted to display the scores (wins, ties, and losses).  I set three variables in the script as shown below (win, loss, and tie) however I do not know how to display those variables constantly.</p>
  
  <p>My code is:
   on <a href="http://632617.wix.com/tictactoegame" rel="nofollow">this website</a></p>
  
  <hr>
  
  <p>My code is below and I want to display the variables, win loss and tie that update constantly:
          
          
          Tic-Tac-Toe
          Will Machines Conquer Mankind?
          </p>
  
  <pre><code>                    if (document.all||document.getElementById){
                  document.write('&lt;style&gt;.tictac{')
                  document.write('width:50px;height:50px;')
                  document.write('}&lt;/style&gt;')
                  }
  
                  var sqr1
                  var sqr2
                  var sqr3
                  var sqr4
                  var sqr5
                  var sqr6
                  var sqr7
                  var sqr8
                  var sqr9
                  var sqr1T = 0;
                  var sqr2T = 0;
                  var sqr3T = 0;
                  var sqr4T = 0;
                  var sqr5T = 0;
                  var sqr6T = 0;
                  var sqr7T = 0;
                  var sqr8T = 0;
                  var sqr9T = 0;
                  var moveCount = 0;
                  var turn = 0;
                  var mode = 1;
                  var win = 0;
                  var lose = 0;
                  var draw = 0;
  
                  function help() {
                  alert("Welcome to Daniel Schwartz's Will Machines Conquer Mankind: Tic-Tac-Toe!  You " + name + " play as the X's and Daniel Schwartz's Artifical Intelligence plays as the O's.  You " + name + " select the square you want to put your X into by clicking it.  A rule is that a X or an O cannot occupy a square that is already occupied by another X or O. The first player to get three squares filled with the user's letter (X's or O's) in a row wins.  Good Luck and enjoy Daniel Schwartz's Will Machines Conquer Mankind: Tic-Tac-Toe!!")
                  }
  
                  function vari()
                  {
                  sqr1 = document.tic.sqr1.value
                  sqr2 = document.tic.sqr2.value
                  sqr3 = document.tic.sqr3.value
                  sqr4 = document.tic.sqr4.value
                  sqr5 = document.tic.sqr5.value
                  sqr6 = document.tic.sqr6.value
                  sqr7 = document.tic.sqr7.value
                  sqr8 = document.tic.sqr8.value
                  sqr9 = document.tic.sqr9.value
                  }
                  function check()
                  {
                    if(sqr1 == " X " &amp;&amp; sqr2 == " X " &amp;&amp; sqr3 == " X ")
                    {
                      win = win + 1;                    
                      alert(name + " Wins!   " + name + " beat the artificial intelligence!")
                      reset()
                    } 
                    else if(sqr4 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr6 == " X ")
                    {
                      win = win + 1;                    
                      alert(name + " Wins!   " + name + " beat the artificial intelligence!")
                      reset()
                    } 
                    else if(sqr7 == " X " &amp;&amp; sqr8 == " X " &amp;&amp; sqr9 == " X ")
                    {
                      win = win + 1;                    
                      alert(name + " Wins!   " + name + " beat the artificial intelligence!")
                      reset()
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr9 == " X ")
                    {
                      win = win + 1;                    
                      alert(name + " Wins!   " + name + " beat the artificial intelligence!")
                      reset()
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr4 == " X " &amp;&amp; sqr7 == " X ")
                    {
                      win = win + 1;                    
                      alert(name + " Wins!   " + name + " beat the artificial intelligence!")
                      reset()
                    }
                    else if(sqr2 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr8 == " X ")
                    {
                      win = win + 1;                    
                      alert(name + " Wins!   " + name + " beat the artificial intelligence!")
                      reset()
                    }
                    else if(sqr3 == " X " &amp;&amp; sqr6 == " X " &amp;&amp; sqr9 == " X ")
                    {
                      win = win + 1;                    
                      alert(name + " Wins!   " + name + " beat the artificial intelligence!")
                      reset()
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr9 == " X ")
                    {
                      win = win + 1;                      
                      alert(name + " Wins!   " + name + " beat the artificial intelligence!")
                      reset()
                    }
                    else if(sqr3 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr7 == " X ")
                    {
                      win = win + 1;                    
                      alert(name + " Wins!   " + name + " beat the artificial intelligence!")
                      reset()
                    }
                    else
                    {
                      winCheck()
                      check2()
                      drawCheck()  
                    } 
                  }
  
                  function check2()
                  {
                    vari()
                    drawCheck()
                    if(sqr1 == " O " &amp;&amp; sqr2 == " O " &amp;&amp; sqr3 == " O ")
                    {
                      lose = lose + 1;                      
                      alert(name + " Loses!   " + name + " lost to the artificial intelligence!")
                      reset()
                    } 
                    else if(sqr4 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr6 == " O ")
                    {
                      lose = lose + 1;                      
                      alert(name + " Loses!   " + name + " lost to the artificial intelligence!")
                      reset()
                    } 
                    else if(sqr7 == " O " &amp;&amp; sqr8 == " O " &amp;&amp; sqr9 == " O ")
                    {
                      lose = lose + 1;                      
                      alert(name + " Loses!   " + name + " lost to the artificial intelligence!")
                      reset()
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr9 == " O ")
                    {
                      lose = lose + 1;                      
                      alert(name + " Loses!   " + name + " lost to the artificial intelligence!")
                      reset()
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr4 == " O " &amp;&amp; sqr7 == " O ")
                    {
                      lose = lose + 1;                      
                      alert(name + " Loses!   " + name + " lost to the artificial intelligence!")
                      reset()
                    }
                    else if(sqr2 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr8 == " O ")
                    {
                      lose = lose + 1;                      
                      alert(name + " Loses!   " + name + " lost to the artificial intelligence!")
                      reset()
                    }
                    else if(sqr3 == " O " &amp;&amp; sqr6 == " O " &amp;&amp; sqr9 == " O ")
                    {
                      lose = lose + 1;                      
                      alert(name + " Loses!   " + name + " lost to the artificial intelligence!")
                      reset()
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr9 == " O ")
                    {
                      lose = lose + 1;                      
                      alert(name + " Loses!   " + name + " lost to the artificial intelligence!")
                      reset()
                    }
                    else if(sqr3 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr7 == " O ")
                    {
                      lose = lose + 1;                      
                      alert(name + " Loses!   " + name + " lost to the artificial intelligence!")
                      reset()
                    }
                  }
  
                  function drawCheck()
                  {
                    vari()
                    moveCount = sqr1T + sqr2T + sqr3T + sqr4T + sqr5T + sqr6T + sqr7T + sqr8T + sqr9T 
                    if(moveCount == 9)
                    {
                      draw = draw + 1;                      
                      alert(name + " and the computer have come to a draw!")
                      reset()
                    }
                  }
  
                  function winCheck()
                  {
                    check2()
                    if(sqr2 == " O " &amp;&amp; sqr3 == " O " &amp;&amp; sqr1T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr1.value = " O "
                      sqr1T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr3 == " O " &amp;&amp; sqr2T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr2.value = " O "
                      sqr2T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr2 == " O " &amp;&amp; sqr3T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr3.value = " O "
                      sqr3T = 1;
                      turn = 0;
                    }
                    else if(sqr5 == " O " &amp;&amp; sqr6 == " O " &amp;&amp; sqr4T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr4.value = " O "
                      sqr4T = 1;
                      turn = 0;
                    }
                    else if(sqr4 == " O " &amp;&amp; sqr6 == " O " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr4 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr6T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr6.value = " O "
                      sqr6T = 1;
                      turn = 0;
                    }
                    else if(sqr8 == " O " &amp;&amp; sqr9 == " O " &amp;&amp; sqr7T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr7.value = " O "
                      sqr7T = 1;
                      turn = 0;
                    }
                    else if(sqr7 == " O " &amp;&amp; sqr9 == " O " &amp;&amp; sqr8T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr8.value = " O "
                      sqr8T = 1;
                      turn = 0;
                    }
                    else if(sqr7 == " O " &amp;&amp; sqr8 == " O " &amp;&amp; sqr9T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr9.value = " O "
                      sqr9T = 1;
                      turn = 0;
                    }
                    else if(sqr4 == " O " &amp;&amp; sqr7 == " O " &amp;&amp; sqr1T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr1.value = " O "
                      sqr1T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr7 == " O " &amp;&amp; sqr4T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr4.value = " O "
                      sqr4T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr4 == " O " &amp;&amp; sqr7T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr7.value = " O "
                      sqr7T = 1;
                      turn = 0;
                    }
                    else if(sqr5 == " O " &amp;&amp; sqr8 == " O " &amp;&amp; sqr2T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr2.value = " O "
                      sqr2T = 1;
                      turn = 0;
                    }
                    else if(sqr2 == " O " &amp;&amp; sqr8 == " O " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr2 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr8T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr8.value = " O "
                      sqr8T = 1;
                      turn = 0;
                    }
                    else if(sqr6 == " O " &amp;&amp; sqr9 == " O " &amp;&amp; sqr3T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr3.value = " O "
                      sqr3T = 1;
                      turn = 0;
                    }
                    else if(sqr3 == " O " &amp;&amp; sqr9 == " O " &amp;&amp; sqr6T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr6.value = " O "
                      sqr6T = 1;
                      turn = 0;
                    }
                    else if(sqr3 == " O " &amp;&amp; sqr6 == " O " &amp;&amp; sqr9T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr9.value = " O "
                      sqr9T = 1;
                      turn = 0;
                    }
                    else if(sqr5 == " O " &amp;&amp; sqr9 == " O " &amp;&amp; sqr1T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr1.value = " O "
                      sqr1T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr9 == " O " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr9T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr9.value = " O "
                      sqr9T = 1;
                      turn = 0;
                    }
                    else if(sqr3 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr7T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr7.value = " O "
                      sqr7T = 1;
                      turn = 0;
                    }
                    else if(sqr3 == " O " &amp;&amp; sqr7 == " O " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr7 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr3T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr3.value = " O "
                      sqr3T = 1;
                      turn = 0;
                    }
                    else
                    {
                      computer()
                    }
                    check2()
                  }
                  function computer()
                  {
                    check2()
                    if(sqr1 == " O " &amp;&amp; sqr5 == " O " &amp;&amp; sqr3 == " X " &amp;&amp; sqr8 == " X " &amp;&amp; sqr9 == " X " &amp;&amp; sqr6T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr6.value = " O "
                      sqr6T = 1;
                      turn = 0;                       
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr4 == " X " &amp;&amp; sqr6 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn ==1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr6 == " X " &amp;&amp; sqr3T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr3.value = " O "
                      sqr3T = 1;
                      turn = 0;                       
                    }           
                    else if(sqr2 == " X " &amp;&amp; sqr3 == " X " &amp;&amp; sqr1T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr1.value = " O "
                      sqr1T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr3 == " X " &amp;&amp; sqr2T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr2.value = " O "
                      sqr2T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr2 == " X " &amp;&amp; sqr3T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr3.value = " O "
                      sqr3T = 1;
                      turn = 0;
                    }
                    else if(sqr5 == " X " &amp;&amp; sqr6 == " X " &amp;&amp; sqr4T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr4.value = " O "
                      sqr4T = 1;
                      turn = 0;
                    }
                    else if(sqr4 == " X " &amp;&amp; sqr6 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr4 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr6T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr6.value = " O "
                      sqr6T = 1;
                      turn = 0;
                    }
                    else if(sqr8 == " X " &amp;&amp; sqr9 == " X " &amp;&amp; sqr7T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr7.value = " O "
                      sqr7T = 1;
                      turn = 0;
                    }
                    else if(sqr7 == " X " &amp;&amp; sqr9 == " X " &amp;&amp; sqr8T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr8.value = " O "
                      sqr8T = 1;
                      turn = 0;
                    }
                    else if(sqr7 == " X " &amp;&amp; sqr8 == " X " &amp;&amp; sqr9T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr9.value = " O "
                      sqr9T = 1;
                      turn = 0;
                    }
                    else if(sqr4 == " X " &amp;&amp; sqr7 == " X " &amp;&amp; sqr1T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr1.value = " O "
                      sqr1T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr7 == " X " &amp;&amp; sqr4T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr4.value = " O "
                      sqr4T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr4 == " X " &amp;&amp; sqr7T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr7.value = " O "
                      sqr7T = 1;
                      turn = 0;
                    }
                    else if(sqr5 == " X " &amp;&amp; sqr8 == " X " &amp;&amp; sqr2T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr2.value = " O "
                      sqr2T = 1;
                      turn = 0;
                    }
                    else if(sqr2 == " X " &amp;&amp; sqr8 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr2 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr8T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr8.value = " O "
                      sqr8T = 1;
                      turn = 0;
                    }
                    else if(sqr6 == " X " &amp;&amp; sqr9 == " X " &amp;&amp; sqr3T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr3.value = " O "
                      sqr3T = 1;
                      turn = 0;
                    }
                    else if(sqr3 == " X " &amp;&amp; sqr9 == " X " &amp;&amp; sqr6T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr6.value = " O "
                      sqr6T = 1;
                      turn = 0;
                    }
                    else if(sqr3 == " X " &amp;&amp; sqr6 == " X " &amp;&amp; sqr9T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr9.value = " O "
                      sqr9T = 1;
                      turn = 0;
                    }
                    else if(sqr5 == " X " &amp;&amp; sqr9 == " X " &amp;&amp; sqr1T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr1.value = " O "
                      sqr1T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr9 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr9T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr9.value = " O "
                      sqr9T = 1;
                      turn = 0;
                    }
                    else if(sqr3 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr7T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr7.value = " O "
                      sqr7T = 1;
                      turn = 0;
                    }
                    else if(sqr3 == " X " &amp;&amp; sqr7 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr7 == " X " &amp;&amp; sqr5 == " X " &amp;&amp; sqr3T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr3.value = " O "
                      sqr3T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr3 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr7 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr9 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;
                    }
                    else if(sqr5 == " O " &amp;&amp; sqr3 == " X " &amp;&amp; sqr7 == " X " &amp;&amp; sqr6T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr6.value = " O "
                      sqr6T = 1;
                      turn = 0;
                    }
                    else if(sqr1 == " O " &amp;&amp; sqr2 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;                       
                    }                       
                    else if(sqr1 == " O " &amp;&amp; sqr3 == " X " &amp;&amp; sqr8 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;                       
                    }         
                    else if(sqr1 == " O " &amp;&amp; sqr8 == " X " &amp;&amp; sqr7 == " X " &amp;&amp; sqr9T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr9.value = " O "
                      sqr9T = 1;
                      turn = 0;                       
                    }
                    else if(sqr8 == " X " &amp;&amp; sqr5T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      sqr5T = 1;
                      turn = 0;                       
                    }                                                   
                    else if(sqr3 == " X " &amp;&amp; sqr5 == " O " &amp;&amp; sqr8 == " X " &amp;&amp; sqr9T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr9.value = " O "
                      sqr9T = 1;
                      turn = 0;                       
                    }                                             
                    else if(sqr1 == " X " &amp;&amp; sqr5 == " O " &amp;&amp; sqr8 == " X " &amp;&amp; sqr6T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr6.value = " O "
                      sqr6T = 1;
                      turn = 0;                       
                    }     
                    else if(sqr1 == " O " &amp;&amp; sqr5 == " X " &amp;&amp; sqr9 == " X " &amp;&amp; sqr3T == 0 &amp;&amp; turn == 1)
                    {
                      document.tic.sqr3.value = " O "
                      sqr3T = 1;
                      turn = 0;                       
                    }     
                    else
                    {
                      ArtificialIntelligence()
                    }
                    check2()
                  }
  
                  function ArtificialIntelligence()
                  {
                    vari()
                    if(document.tic.sqr1.value == "     " &amp;&amp; turn == 1)
                    {
                      document.tic.sqr1.value = " O "
                      turn = 0
                      sqr1T = 1
                    }
                    else if(document.tic.sqr2.value == "     " &amp;&amp; turn == 1)
                    {
                      document.tic.sqr2.value = " O "
                      turn = 0
                      sqr2T = 1
                    }
                    else if(document.tic.sqr3.value == "     " &amp;&amp; turn == 1)
                    {
                      document.tic.sqr3.value = " O "
                      turn = 0
                      sqr3T = 1
                    }
                    else if(document.tic.sqr4.value == "     " &amp;&amp; turn == 1)
                    {
                      document.tic.sqr4.value = " O "
                      turn = 0
                      sqr4T = 1
                    }
                    else if(document.tic.sqr5.value == "     " &amp;&amp; turn == 1)
                    {
                      document.tic.sqr5.value = " O "
                      turn = 0
                      sqr5T = 1
                    }
                    else if(document.tic.sqr6.value == "     " &amp;&amp; turn == 1)
                    {
                      document.tic.sqr6.value = " O "
                      turn = 0
                      sqr6T = 1
                    }
                    else if(document.tic.sqr7.value == "     " &amp;&amp; turn == 1)
                    {
                      document.tic.sqr7.value = " O "
                      turn = 0
                      sqr7T = 1
                    }
                    else if(document.tic.sqr8.value == "     " &amp;&amp; turn == 1)
                    {
                      document.tic.sqr8.value = " O "
                      turn = 0
                      sqr8T = 1
                    }
                    else if(document.tic.sqr9.value == "     " &amp;&amp; turn == 1)
                    {
                      document.tic.sqr9.value = " O "
                      turn = 0
                      sqr9T = 1
                    }
                    check2()
                  }
  
                  function reset()
                  {
                    document.tic.sqr1.value = "     "
                    document.tic.sqr2.value = "     "
                    document.tic.sqr3.value = "     "
                    document.tic.sqr4.value = "     "
                    document.tic.sqr5.value = "     "
                    document.tic.sqr6.value = "     "
                    document.tic.sqr7.value = "     "
                    document.tic.sqr8.value = "     "
                    document.tic.sqr9.value = "     "
                    sqr1T = 0
                    sqr2T = 0
                    sqr3T = 0
                    sqr4T = 0
                    sqr5T = 0
                    sqr6T = 0
                    sqr7T = 0
                    sqr8T = 0
                    sqr9T = 0
                    vari()
                    turn = 0
                    moveCount = 0
                  }
  
                  function resetter()
                  {
                    reset()
                  }
  </code></pre>
  
  <p></p>
  
  <p>
  
  
  <br />
  
  
  <br />
  
  
  
  </p>
  
  <p></p>
  
  <pre><code>&lt;/head&gt;
  &lt;body&gt;
      &lt;div id ="box"&gt;
          &lt;h1&gt;Created By: Daniel Schwartz&lt;/h1&gt;
          &lt;font size="10" color="orange"&gt;Cherokee High School&lt;/font&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>
   </p>