You won!


` + document.querySelectorAll('span')[0].innerHTML + document.querySelectorAll('span')[1].innerHTML + document.querySelectorAll('span')[2].innerHTML + '
' + document.querySelectorAll('span')[3].innerHTML + document.querySelectorAll('span')[4].innerHTML + document.querySelectorAll('span')[5].innerHTML + '
' + document.querySelectorAll('span')[6].innerHTML + document.querySelectorAll('span')[7].innerHTML + document.querySelectorAll('span')[8].innerHTML + `

■ = empty square ` } } if (!XO) { if (document.querySelectorAll('span')[solutionArray[0] - 1].innerHTML === 'O' && document.querySelectorAll('span')[solutionArray[1] - 1].innerHTML === 'O' && document.querySelectorAll('span')[solutionArray[2] - 1].innerHTML === 'O') { someoneWon = true; document.documentElement.innerHTML = `

The computer won!



` + document.querySelectorAll('span')[0].innerHTML + document.querySelectorAll('span')[1].innerHTML + document.querySelectorAll('span')[2].innerHTML + '
' + document.querySelectorAll('span')[3].innerHTML + document.querySelectorAll('span')[4].innerHTML + document.querySelectorAll('span')[5].innerHTML + '
' + document.querySelectorAll('span')[6].innerHTML + document.querySelectorAll('span')[7].innerHTML + document.querySelectorAll('span')[8].innerHTML + `

■ = empty square ` } } } function c1() { checkPlayer() checkComputer() if (doNotPick.length == 9 && !someoneWon) { setTimeout(function() { document.documentElement.innerHTML = `

Tie!


` + document.querySelectorAll('span')[0].innerHTML + document.querySelectorAll('span')[1].innerHTML + document.querySelectorAll('span')[2].innerHTML + '
' + document.querySelectorAll('span')[3].innerHTML + document.querySelectorAll('span')[4].innerHTML + document.querySelectorAll('span')[5].innerHTML + '
' + document.querySelectorAll('span')[6].innerHTML + document.querySelectorAll('span')[7].innerHTML + document.querySelectorAll('span')[8].innerHTML + `

■ = empty square ` }, 5) } } setInterval(function(){ checkPlayer() checkComputer() c1() })