document.addEventListener('htmx:wsConfigSend', function(e) { if (e.target.classList.contains('board-cell')) { const row = parseInt(e.target.dataset.row); const col = parseInt(e.target.dataset.col); // Set the custom JSON data e.detail.parameters = { type: "make_move", row: row, col: col }; } });