// Make a play async function play(cell) { response = await fetch(`/play/${cell}/${game.color}`); await updateGame(response) poll(); } // Set up click handlers and start polling. async function init() { poll(); let i = 0; for (const button of document.querySelectorAll(".grid button")) { const cell = i; button.addEventListener('click', () => play(cell)); i++; } } init()