Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/12/2008, 03:48
Avatar de ZiTAL
ZiTAL
 
Fecha de Ingreso: marzo-2004
Ubicación: Bermio (Bizkaia)
Mensajes: 1.545
Antigüedad: 20 años, 1 mes
Puntos: 62
Respuesta: Borrar filas dinamicamente (removeChild)

Código HTML:
<html>
<head>
<script type="text/javascript" src="main.js">
</script>
</head>
<body>
<table>
<tr>
	<td>Bat</td>
	<td><input type="button" onclick="remove(this)" value="Eliminar" /></td>
</tr>
<tr>
	<td>Bi</td>
	<td><input type="button" onclick="remove(this)" value="Eliminar" /></td>
</tr>
<tr>
	<td>Hiru</td>
	<td><input type="button" onclick="remove(this)" value="Eliminar" /></td>
</tr>
</table>
</body>
</html> 
main.js

Código javascript:
Ver original
  1. function remove(t)
  2.     {
  3.         var td = t.parentNode;
  4.         var tr = td.parentNode;
  5.         var table = tr.parentNode;
  6.         table.removeChild(tr);
  7.     }
__________________
http://zital.no-ip.org
____________________

Euskerie ahuen eta bijotzan