title: Dynamic HTML row - add id on TR
body: <p>How to add an ID (value 1, 2, 3, etc.) on each new 
  I have now so that my script creates a new row, but would need an ID to each </p>
  
  <p><a href="http://jsfiddle.net/pkz1vszu/" rel="nofollow">FIDDLE</a></p>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code>function deleteRow(tableID) {
      try {
          var table = document.getElementById(tableID);
          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("Cant delete all rows");
                      break;
                  }
                  table.deleteRow(i);
                  rowCount--;
                  i--;
              }
          }
      }catch(e) {
          alert(e);
      }
  }
  </code></pre>