Switching turns in JavaScript Tic-Tac-Toe? -
i've got this, ideas of how can program switch turns between players it?
add below if(haswon) clause:
var turnbtn = document.getelementbyid('turn'); turnbtn.value = (turnbtn.value == "x") ? "o" : "x";
i've got this, ideas of how can program switch turns between players it?
add below if(haswon) clause:
var turnbtn = document.getelementbyid('turn'); turnbtn.value = (turnbtn.value == "x") ? "o" : "x";
Comments
Post a Comment