javaScript count table row

var rowCount = document.getElementById('myTableID').rows.length;
Kriss Sachintha