title: Loop through an ASP.Net table
body: <p>I have a table which is created dynamically through C#; now I have a simple client side checkbox which will loop through the table each time it's clicked. I think I can handle looping through the table, currently though I'm just having issues of trying to loop through the table using JavaScript.</p>
  
  <p>So far I have a checkbox:
      </p>
  
  <p>Then I have my function which will loop through the table</p>
  
  <pre><code>&lt;script&gt;
      function LoopThroughTable() {
          var chkState = document.getElementById("chkSelectAll");
          alert(document.getElementById("fileTablePersonal").rows.length);
  
          if (chkState.checked) {
              alert("Loop through table");
          } else {
              alert("Loop through table again");
          }
       }
  &lt;/script&gt;
  </code></pre>
  
  <p>My main issue at the minute is that I can't alert the number or rows or columns using JavaScript, I'm using rows.length but that doesn't seem to work</p>
  
  <p>Any help would be awesome</p>
  
  <p>Edit: My table is created using Asp.Net</p>