hi how to get with javascript the rows count of a html table having id and name.
thanks
hi how to get with javascript the rows count of a html table having id and name.
thanks
You can get it row .rows property and check it's .length, like this:
var rowCount = document.getElementById('myTableID').rows.length;
Basically:
var rows = document.getElementById(tableId).getElementsByTagName("tr").length;
Or if there's a <tbody> in between,
var rows = document.getElementById(tableId).getElementsByTagName("tbody")[0].getElementsByTagName("tr").length;