Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/08/2015, 13:07
Jose789
 
Fecha de Ingreso: diciembre-2012
Ubicación: Murcia
Mensajes: 329
Antigüedad: 11 años, 5 meses
Puntos: 4
Jquery eliminar <tr>

Hola gente, pues tengo un problemilla con este asunto.

He probado con $(this).parent().remove(); pero sin ningún resultado


Código HTML:
Ver original
  1. <table class="table">
  2. <tr>
  3. <th>Account_id</th>
  4. <th>Alerta</th>
  5. <th></th>
  6. </tr>
  7. <tr>
  8. <th scope="row">1</th>
  9. <td>Mensaje</td>
  10. <td><a href="#" class="delete" onclick="borrar(1);">Eliminar</a></td>
  11. </tr>
  12. <tr>
  13. <th scope="row">2</th>
  14. <td>Mensaje</td>
  15. <td><a href="#" class="delete" onclick="borrar(2);">Eliminar</a></td>
  16. </tr>
Código Javascript:
Ver original
  1. function borrar(id) {
  2.         console.log(id);
  3.            $(this).closest('tr').remove();
  4. }

Haber si alguien me puede echar una mano Gracias de ante mano.