Quiero hacer un juego de tic tac toe, tratando de agarrar todo el td usando querySelectorAll y usando eventlistner estoy tratando de manipular el 'td' pero muestra un error
aquí está el código html:
<body> <h1> Welcome to tic tac toe game </h1> <button onclick="history.go(0)"> Restart </button> <table border="1" align="center" > <tr> <td> </td> <td > </td> <td ></td> </tr> <tr> <td> </td> <td ></td> <td ></td> </tr> <tr> <td> </td> <td ></td> <td ></td> </tr> </table>JavaScript:
let cell = document.querySelectorAll('td'); cell.addEventListner('click',function(){ cell.textContent = 'x'; })Error : **
tic_toe_game.js:2 Uncaught TypeError: cell.addEventListner is not a function at tic_toe_game.js:2:6**