1

Trying to make a tictactoe game and setting the players and the player moves and It's giving me errors in both vs code and the inspect portion of the webpage. Getting 'This constructor function may be converted to a class declaration.ts(80002)' in vs code and 'Uncaught TypeError: Cannot set properties of null (setting 'textContent')' in the inspect on the url.

function setPlayer() {
  mark = this.value;
  msg.textContent = mark + ', click on a square to make your move!';
  choice.classList.add('good-luck');
  this.checked = false;
  buildGrid();
}

function playerMove() {
  if (this.textContent == '') {
    this.textContent = mark;
    checkRow();
    switchMark();
    computerMove();
  }
}

new to javascript, I can't figure out what I am doing wrong.

I don't know what to try

0

Browse other questions tagged or ask your own question.