Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/01/2008, 09:24
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 23 años
Puntos: 772
Re: Problemas con seleccion de ID en tablas

Hola PP2

Te pongo un ejemplo que no necesita usar id, espero que te sirva:

Código PHP:
<html>
<
head>
<
script type="text/javascript">
var 
celda null;
function 
cambiar(obj) {
  
obj.style.background '#f00';
  if (
celdacelda.style.background '';
  
celda obj;
}
</script>
</head>
<body>
<table>
<tr>
<td onclick="cambiar(this)">Uno</td>
<td onclick="cambiar(this)">Dos</td>
<td onclick="cambiar(this)">Tres</td>
</tr>
</table>
</body>
</html> 
Saludos,