Answer: Write below code:-
var table_rows_cnt = document.getElementById('your_table_id').getElementsByTagName("tr").length;
alert(table_rows_cnt);
Or you can also write:-
var table_rows_cnt = document.getElementById('your_table_id').rows.length;
alert(table_rows_cnt);
Asked In: Many Interviews |
Alert Moderator