Removing mulitple selected Rows + with rowspan
<p>I would like to delete selected rows with rowspan and an extra one below, a total of 4 rows, you can see that each 4 stack of rows represent 1 entry. The function deleteSelectedRows() below does not work correctly; it only deletes the one selected. Could you please help!</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table  id="my_table" id="my_table" align="center" width="100%" border="1" cellpadding="0" cellspacing="0"&gt;
    &lt;tbody&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th &gt;No&lt;/th&gt;
        &lt;th &gt;Location&lt;/th&gt;
        &lt;th &gt;Time&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt; &lt;!-- new entry #1 --&gt;
        &lt;td rowspan="3"&gt;&lt;input type="checkbox"&gt;1a&lt;td&gt;
        &lt;td&gt;1a&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;2a&lt;/td&gt;
        &lt;td&gt;2a&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;3a&lt;/td&gt;
        &lt;td&gt;3a&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr &gt;
        &lt;td colSpan="3"&gt;4a&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt; &lt;!-- new entry #2--&gt;
        &lt;td rowspan="3"&gt;&lt;input type="checkbox"&gt;1b&lt;td&gt;
        &lt;td&gt;1b&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;2b&lt;/td&gt;
        &lt;td&gt;2b&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;3b&lt;/td&gt;
        &lt;td&gt;3b&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr &gt;
        &lt;td colSpan="3"&gt;4b&lt;/td&gt;
      &lt;/tr&gt;
     &lt;/thead&gt;&lt;/tbody&gt;
    &lt;/table&gt;
    &lt;div&gt;&lt;input type="button" value="Delete selected rows" onClick="deleteSelectedRows()"/&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/HTML&gt;
   &lt;SCRIPT language="javascript"&gt;
    function deleteSelectedRows() {    
     var table = document.getElementById('my_table'); //html table
     var rowCount = table.rows.length; //no. of rows in table          
     for(var i=0; i&lt; rowCount; i++) { //loops for all row in table 

      var row = table.rows[i]; //return a particular row              
      var chkbox = row.cells[0].childNodes[0]; //get check box onject               
      if(null != chkbox &amp;&amp; true == chkbox.checked) { //wheather check box is selected                   
       table.deleteRow(i); //delete the selected row   

       rowCount = rowCount-1; //decrease rowcount by 1                   
       i--;               
      }             
     }
    }
&lt;/script&gt;
</code></pre>
