Add this below your if(hasWon) clause:
var turnBtn = document.getElementById('turn');
turnBtn.value = (turnBtn.value == "X") ? "O" : "X";
solved Switching turns in JavaScript Tic-Tac-Toe? [closed]
Add this below your if(hasWon) clause:
var turnBtn = document.getElementById('turn');
turnBtn.value = (turnBtn.value == "X") ? "O" : "X";
solved Switching turns in JavaScript Tic-Tac-Toe? [closed]