Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 1.04 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to remove a tag from table by id
  2. <table>
  3.     <tr>
  4.         <td>ID: 1</td>
  5.         <td align="left" width='20%'>
  6.             <div class='tools'>
  7.                 <a href='http://localhost/www/GestIEFP/index.php/admin/groups/index/delete/1' title='Remover Grupo' class="delete-row" ><span class='delete-icon'></span></a>
  8.                 <a href='http://localhost/www/GestIEFP/index.php/admin/groups/index/edit/1' title='Editar Grupo'><span class='edit-icon'></span></a>
  9.                 <div class='clear'></div>
  10.             </div>
  11.         </td>
  12.     </tr>
  13. </table>
  14.        
  15. $(function(){
  16.     $('table').find("td:contains('ID: 1')")
  17.     .each ( function () {
  18.         $('a').remove();
  19.     })
  20. })
  21.        
  22. $(function(){
  23.     $('table').find("td:contains('ID: 1')")
  24.     .each ( function () {
  25.         $(this).next('td').find('a').remove();
  26.     })
  27. });
  28.        
  29. $("table td:contains('ID: 1')").closest("tr").find("a").remove();
  30.        
  31. $("td:contains('ID: 1')").next().find('a').remove()​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​