DEV Community

Discussion on: Pure and Simple - Tic Tac Toe with Javascript

Collapse
 
cforsyth68 profile image
Charles Forsyth • Edited

Wouldn't this be better? (event delegation, so there is only only event listener)

document
  .querySelector(".game--container")
  .addEventListener("click", handleCellClick);
Enter fullscreen mode Exit fullscreen mode
Collapse
 
pcamellon profile image
Pcamellon

How would I know the clicked cell?