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 java script, I can’t figure out what I am doing wrong.
I don’t know what to try
Spencer Durfey is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.