title: jQuery Delete From Table
body: <p><strong>This code does following:</strong></p>
  
  <ul>
  <li>Click on "Delete" in item row -> deletes item row</li>
  <li>Click on "Delete" in category row -> deletes category row and all item rows (in all table)</li>
  </ul>
  
  <p><strong>Need it to do following:</strong></p>
  
  <ul>
  <li>Click on "Delete" in item row -> delete item row (WORKS PERFECTLY)</li>
  <li>Click on "Delete" in category row -> delete category row and all items inside that category row (DOES WORK YET)</li>
  </ul>
  
  <p>Live demo: <a href="http://usercp.athensluna.net:81/mall_manager2/" rel="nofollow noreferrer">http://usercp.athensluna.net:81/mall_manager2/</a></p>
  
  <p><strong>Table:</strong></p>
  
  <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"&gt;
      &lt;head&gt;
          &lt;title&gt;Go go Luna!&lt;/title&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
          &lt;link rel="stylesheet" type="text/css" href="styles.css" /&gt;
          &lt;script type="text/javascript" src="jquery.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="jquery.jeditable.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;                                         
              $(document).ready(function() {
                  $("tr.item .delete").click(function(){
                      $.post("do.php", { what: "delete", q: $(this).attr("id") });
                      $(this).parent().parent().fadeOut("fast");
                  });
  
                  $("tr.category a.delete").click(function(e){
                      $(this).parent().parent().fadeOut("fast");
                      $(this).parent().parent().nextAll("tr.item").fadeOut("fast");
                  });
  
              });
          &lt;/script&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="wrapper"&gt;
              &lt;div id="header"&gt;&lt;/div&gt;
              &lt;div id="main"&gt;
  &lt;table class="stats" width="100%"&gt;
      &lt;tr class="category"&gt;
          &lt;td colspan="2"&gt;Costumes&lt;br /&gt;&lt;small&gt;Make your character look uniqe&lt;/small&gt;&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="category:1"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="item"&gt;
          &lt;td&gt;Godly Weapon&lt;br /&gt;&lt;small&gt;Super wepons of gods&lt;/small&gt;&lt;br /&gt;&lt;small&gt;images/godly_weapon.png&lt;/small&gt;&lt;/td&gt;
          &lt;td width="120"&gt;1000 Athen Coins&lt;br /&gt;$1 Paypal&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="item:1:1"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="item"&gt;
          &lt;td&gt;Godly Weapon&lt;br /&gt;&lt;small&gt;Super wepons of gods&lt;/small&gt;&lt;br /&gt;&lt;small&gt;images/godly_weapon.png&lt;/small&gt;&lt;/td&gt;
          &lt;td width="120"&gt;1000 Athen Coins&lt;br /&gt;$1 Paypal&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="item:1:2"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="item"&gt;
          &lt;td&gt;Godly Weapon&lt;br /&gt;&lt;small&gt;Super wepons of gods&lt;/small&gt;&lt;br /&gt;&lt;small&gt;images/godly_weapon.png&lt;/small&gt;&lt;/td&gt;
          &lt;td width="120"&gt;1000 Athen Coins&lt;br /&gt;$1 Paypal&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="item:1:3"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="item"&gt;
          &lt;td&gt;Godly Weapon&lt;br /&gt;&lt;small&gt;Super wepons of gods&lt;/small&gt;&lt;br /&gt;&lt;small&gt;images/godly_weapon.png&lt;/small&gt;&lt;/td&gt;
          &lt;td width="120"&gt;1000 Athen Coins&lt;br /&gt;$1 Paypal&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="item:1:4"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="item"&gt;
          &lt;td&gt;Godly Weapon&lt;br /&gt;&lt;small&gt;Super wepons of gods&lt;/small&gt;&lt;br /&gt;&lt;small&gt;images/godly_weapon.png&lt;/small&gt;&lt;/td&gt;
          &lt;td width="120"&gt;1000 Athen Coins&lt;br /&gt;$1 Paypal&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="item:1:5"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="category"&gt;
          &lt;td colspan="2"&gt;Costumes&lt;br /&gt;&lt;small&gt;Make your character look uniqe&lt;/small&gt;&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="category:2"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="item"&gt;
          &lt;td&gt;Godly Weapon&lt;br /&gt;&lt;small&gt;Super wepons of gods&lt;/small&gt;&lt;br /&gt;&lt;small&gt;images/godly_weapon.png&lt;/small&gt;&lt;/td&gt;
          &lt;td width="120"&gt;1000 Athen Coins&lt;br /&gt;$1 Paypal&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="item:2:1"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="item"&gt;
          &lt;td&gt;Godly Weapon&lt;br /&gt;&lt;small&gt;Super wepons of gods&lt;/small&gt;&lt;br /&gt;&lt;small&gt;images/godly_weapon.png&lt;/small&gt;&lt;/td&gt;
          &lt;td width="120"&gt;1000 Athen Coins&lt;br /&gt;$1 Paypal&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="item:2:2"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="category"&gt;
          &lt;td colspan="2"&gt;Costumes&lt;br /&gt;&lt;small&gt;Make your character look uniqe&lt;/small&gt;&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="category:3"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr class="item"&gt;
          &lt;td&gt;Godly Weapon&lt;br /&gt;&lt;small&gt;Super wepons of gods&lt;/small&gt;&lt;br /&gt;&lt;small&gt;images/godly_weapon.png&lt;/small&gt;&lt;/td&gt;
          &lt;td width="120"&gt;1000 Athen Coins&lt;br /&gt;$1 Paypal&lt;/td&gt;
          &lt;td width="80"&gt;&lt;a href="#" class="delete" id="item:3:1"&gt;Delete&lt;/a&gt;&lt;br /&gt;Invisible&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
              &lt;/div&gt;
              &lt;div id="footer"&gt;Template by &lt;a href="http://danspd.com" target="_blank"&gt;DanSpd&lt;/a&gt;&lt;/div&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>