I want to make a tic tac toe game , trying to grab all the td using querySelectorAll and and by using eventlistner i am trying to manipulate the 'td' but its showing error
here is html code:
<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
**