Category: JQuery
Counting table row using jquery with click event

This type of operation is very easy using javascript / HTML-DOM . The jquery is more practising trend of time.

<!DOCTYPE html>



<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>





    var rc = document.getElementById("myTable").rows.length;   /*we can use this also:   var $rc=$('#myTable tr').length;]  */









<table id="myTable" border="1">


    <td>cell 1</td>

    <td>cell 2</td>



    <td>cell 3</td>

    <td>cell 4</td>




<button type="button" id="but1" >Show number of rows in table</button>