guitarplayer616

JS printAllCells

Feb 11th, 2021 (edited)
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.25 KB | None | 0 0
  1. var table = document.querySelector("tbody")
  2. var str = ""
  3. for (var i = 0, row; row = table.rows[i]; i++) {
  4.     for (var j = 0, cell; cell = row.cells[j]; j++) {
  5.         str = str + cell.innerText + ', '
  6.     }
  7.     str = str + '\n'
  8. }
  9. console.log(str)
Add Comment
Please, Sign In to add comment