tic-tac-toe/js/app.js
// When any of the two buttons (start and restart) are clicked, this function runs:
When any of the two buttons (start and restart) are clicked, this function runs.
When any of the two buttons ( start and restart ) are clicked this function runs .
function btnClicked() {
        $("#player1").toggleClass("active");
        if (start.isOn) {
            start.switchOff();
            board.switchOn();
            player_O.turn = true;
            player_O.name = $("#playerinput1").val();
            player_X.name = $("#playerinput2").val();
        } else if (finish.isOn) {
            reset();
        }
    }
function btnClicked ( ) { $ ( "#player1" ) . toggleClass ( "active" ) ; if ( start . isOn ) { start . switchOff ( ) ; board . switchOn ( ) ; player_O . turn = true ; player_O . name = $ ( "#playerinput1" ) . val ( ) ; player_X . name = $ ( "#playerinput2" ) . val ( ) ; } else if ( finish . isOn ) { reset ( ) ; } }
When any of the two buttons (start and restart) are clicked, this function runs:
When any of the two buttons ( start and restart ) are clicked this function runs :
// No matter what page we are using, toggle player 1's active class. //if the start page is currently showing, make it do what // it's supposed to do, switch the current page off and turn the board on: // Initially giving the list item that shows whose player's turn it is // run the reset function: