JSFiddle - React, Tailwind, and code Playground

by Qwerty_Wasd

HTML

<table id = "table1">
  <tbody>
    <tr>
      <td><input type="text"></td>
      <td><input type="text"></td>
      <td><input type="text"></td>
    </tr>
    <tr>
      <td><input type="text"></td>
      <td><input type="text"></td>
      <td><input type="text"></td>
    </tr>
  </tbody>
</table>

JavaScript

document.querySelectorAll(`#table1 input`).forEach((el, i) => el.dataset.num = i);
document.getElementById(`table1`).addEventListener(`input`, e => {
  if (e.target.tagName === `INPUT`) console.log(`â„–${e.target.dataset.num}-${e.target.value}`);
});