title: Type error: cannot read property 'rows' of null when deleting a row using javascript
body: <p>I have this javascript</p>
  
  <pre><code>function deleteRow(tableID) 
        {
              try {
              var table = document.getElementById(collct_table_body);
              var rowCount = table.rows.length;
  
              for(var i=0; i&lt;rowCount; i++) {
                  var row = table.rows[i];
                  var chkbox = row.cells[0].childNodes[0];
                  if(null != chkbox&amp;&amp; true == chkbox.checked) {
                      if(rowCount &lt;= 1) {
                          alert("Cannot delete all the rows.");
                          break;
                      }
                      table.deleteRow(i);
                      rowCount--;
                      i--;
                  }
  
  
              }
              }catch(e) {
                  alert(e);
              }
  </code></pre>
  
  <p>But when I try to delete a row using this it shows an error "cannot read property 'rows' of null type error"</p>
  
  <p>Is there any error in this javascript Im using?Can some one help me out?</p>