How to get table row value in JavaScript?

To get table row value in JavaScript, use querySelector to get td value by row and column indexes.

So if this is your table:

<table id="my-table">

Then you can get the value of, say, td, that holds 8 with this JavaScript:

const cell = document.querySelector('#my-table tr:nth-child(3) td:nth-child(2)');

console.log(cell.textContent); // 8