title: Deleting rows in a table dynamically
body: <p>I am making a mail web application .So while showing all inbox messages at top i am having a image button to delete all those items that are checked in corresponding checkboxes of rows of my mail table.</p>
  
  <p>My image for delete is :</p>
  
  <pre><code>&lt;img src="images/delete.png" /&gt;&lt;/div&gt;
  </code></pre>
  
  <p>And for each row the row fetches data from database and is something like this : </p>
  
  <pre><code>&lt;tr bgcolor="#5D7B9D" color="#FFFFFF" onmouseover="ChangeColor(this, true,true);" onmouseout="ChangeColor(this, false,true);" onclick="DoNav('showmail.jsp?mid=&lt;%=messageid%&gt;');"&gt;    
  &lt;td&gt;&lt;input type="checkbox" onclick="DoRemove(event);" width="20"&gt;&lt;/td&gt;
  &lt;td callspan="3" width="1000px"&gt;&lt;%=sendername%&gt;  :   &lt;%=messagesubject%&gt;      &lt;%=sendingtime%&gt;&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>Now how to remove the rows dynamically from my rows and at the same time from the database too.Please help</p>
  
  <p>EDIT : </p>
  
  <p>I was trying to put all checked rows checkboxes ids in an array.Whats wrong with this ?</p>
  
  <pre><code>try {
          var checkedrows=[]
          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) {
                  //table.deleteRow(i);
                  checkedrows.push(e.prop(chkbox.id));
  
              }
  
  
          }
          }catch(e) {
              alert(e);
          }
  }
  </code></pre>