this is my tbody structure
<tbody class="tbl_documents_body">
<tr>....</tr>
<tr>....</tr>
<tr>....</tr>
</tbody>
select tbody by class name and print it on console:
let tr = document.getElementsByClassName('tbl_documents_body');
console.log('tr',tr);
will show the tbody element on console, like this:
tr
HTMLCollection [tbody.tbl_documents_body]
0: tbody.tbl_documents_body
length: 1
[[Prototype]]: HTMLCollection
there are plenty of things if I click 0:
and if I add [0] like this:
let tr = document.getElementsByClassName('tbl_documents_body')[0];
console.log('tr',tr);
it will only show all the tr inside the body:
I wonder why it works like this.
thanks!