Tema: innerhtml
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/11/2004, 16:18
herrezuelo
 
Fecha de Ingreso: abril-2004
Ubicación: Madrid
Mensajes: 159
Antigüedad: 20 años, 11 meses
Puntos: 0
innerhtml

Alguien sabria decirme por que no me funciona esto ?
me da un error, al intentar añadir la fila a la tabla.
solo funcion con divs ?

<head>
<title>pagina</title>
<script>
function AñadeFila(){
document.getElementById('tabla').innerHTML ='<tr><td>CELDA3</td></tr>';
}
</script>
</head>

<body>
<table id="tabla" border="1">
<tr>
<td>celda1</td>
</tr>
<tr>
<td>celda2</td>
</tr>
</table>

<input type="button" value="boton" onclick="AñadeFila()">

</body>