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 originalfunction remove(t)
{
var td = t.parentNode;
var tr = td.parentNode;
var table = tr.parentNode;
table.removeChild(tr);
}