title: HTML,Javascript-how to delete the rows of a table which are selected in check box
body: <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt;
  &lt;head&gt;
      &lt;title&gt;Ticket Forwarding&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body style="background-image:url('bg.png')"&gt;
      &lt;style type="text/css"&gt;
      table.imagetable {
          font-family: verdana,arial,sans-serif;
          font-size:11px;
          color:#333333;
          border-width: 1px;
          border-color: #999999;
          border-collapse: collapse;
      }
  
      table.imagetable th {
          background:#b5cfd2 url('cell-blue.jpg');
          border-width: 1px;
          padding: 8px;
          border-style: solid;
          border-color: #999999;
      }
  
      table.imagetable td {
          background:#dcddc0 url('cell-grey.jpg');
          border-width: 1px;
          padding: 8px;
          border-style: solid;
          border-color: #999999;
      }
      &lt;/style&gt;
  
      &lt;script language="javascript"&gt;
      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)
                  {
                      table.deleteRow(i);
                      rowCount--;
                      i--;
                  }
              }
          }
          catch(e){alert(e);}
      }
      &lt;/script&gt;
  
      &lt;img src="abstergo.jpg"&gt;
      &lt;p style="color:#8A2BE2;font-family:Lucida Console;font-size:25px;background-    
  image:url('cell-blue.jpg');margin:0px;width:1800px";&gt; I.T.S-&gt;Forwarding &amp; setting   
  priorities for a ticket &lt;/p&gt;&lt;br&gt;
  
      &lt;table class="imagetable"  id="datatable"  style="margin:20px 0px 0px 50px"&gt;
          &lt;tr&gt;
              &lt;th&gt;ID&lt;/th&gt;
              &lt;th&gt;Subject&lt;/th&gt;
              &lt;th&gt;Subtopic&lt;/th&gt;
              &lt;th&gt;Message&lt;/th&gt;
              &lt;th&gt;Severity&lt;/th&gt;
              &lt;th&gt;Priority&lt;/th&gt;
              &lt;th&gt;Status&lt;/th&gt;
              &lt;th&gt;forward to&lt;/th&gt;
              &lt;th&gt;checkbox&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;1&lt;/td&gt;&lt;td&gt;login problem&lt;/td&gt;         
              &lt;td&gt;
                  &lt;select name="helptopic"&gt;
                      &lt;option value="accounts"&gt;accounts&lt;/option&gt;
                      &lt;option value="admin issues"&gt;admin issues&lt;/option&gt;
                      &lt;option value="it-support" selected&gt;it-support&lt;/option&gt;
                      &lt;option value="project enquiry"&gt;project enquiry&lt;/option&gt;
                      &lt;option value="general enquiry"&gt;general enquiry&lt;/option&gt;
                      &lt;option value="tech. support"&gt;tech. support&lt;/option&gt;
                      &lt;option value="feedback"&gt;feedback&lt;/option&gt;
                      &lt;option value="others"&gt;others&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
              &lt;td&gt;Unable to login&lt;/td&gt;
              &lt;td&gt;
                  &lt;select name="severity"&gt;
                      &lt;option&gt;Minor&lt;/option&gt;
                      &lt;option&gt;Normal&lt;/option&gt;
                      &lt;option&gt;Major&lt;/option&gt;
                      &lt;option&gt;Critical&lt;/option&gt;
                  &lt;/select&gt;                
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;select name="priority"&gt;
                      &lt;option&gt;Low&lt;/option&gt;
                      &lt;option&gt;Medium&lt;/option&gt;
                      &lt;option&gt;High&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;select name="status"&gt;
                      &lt;option&gt;New&lt;/option&gt;
                      &lt;option&gt;Assigned&lt;/option&gt;
                      &lt;option&gt;Resolved&lt;/option&gt;
                  &lt;/select&gt;
              &lt;/td&gt;
              &lt;td&gt;&lt;input type="text" size="30"&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input type="checkbox" name="chk"/&gt;&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;input type="button" value="Forward" onclick="deleteRow('datatable')" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>above is the code which i made.here the first row of the table is headings.from second row onwards the table contains data.i want to delete the row which is selected in check box and when i click on forward button.but the above code is not working.pls help</p>