Setting Label Text to Number of Rows with jQuery

caphowdy

New Member
This is my code but nothing happens.\[code\]$(document).ready(function() { var totalRows = $("#<%=GridView3.ClientID %> tr").length; document.getElementById('Label6').InnerHTML = totalRows;});\[/code\]this is what i ended up using\[code\]var rqnum = $("#<%=GridView3.ClientID %> tr").length - 1;document.getElementById('rqnum').innerHTML = rqnum;var oknum = $("#<%=GridView4.ClientID %> tr").length - 1;document.getElementById('oknum').innerHTML = oknum;var xlnum = $("#<%=GridView5.ClientID %> tr").length - 1;document.getElementById('xlnum').innerHTML = xlnum;var dynum = $("#<%=datalist1.ClientID %> tr").length / 3;document.getElementById('dynum').innerHTML = dynum;\[/code\]this way it subtracts the header, however, how can i make it so if it is 0 dont subtract the -1 because i dont want negatives
 
Back
Top