const tbody = document.querySelector('#Board'); tbody.addEventListener('click', function (e) { const cell = e.target.closest('td'); if (!cell) {return;} // Quit, not clicked on a cell const row = cell.parentElement; console.log(cell.innerHTML, row.rowIndex, cell.cellIndex); });