Ver Mensaje Individual
  #3 (permalink)  
Antiguo 21/11/2012, 12:05
orenxrei
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: Problema al cambiar color de tr con javascript

ok, te pongo el html, hice la prueba y si funciono, pero en el código php las filas se generan automaticamente y no funciona el script...
Código HTML:
Ver original
  1.     <title>pruebas</title>
  2.      <script type="text/javascript">
  3.     function cambiar(obj) {
  4.     elem=obj.parentNode.parentNode;
  5.     elem.style.background=obj.checked ? '#ff0' : '';
  6.     }
  7.   </script>
  8. </head>
  9.  
  10.           <tr>
  11.             <td class="fila"><input type="checkbox" onClick="cambiar(this)"/></td>
  12.             <td class="fila>"><span>'idCliente</span></td>
  13.             <td class="fila>"><span>razonSocial</span></td>
  14.             <td class="fila>"><span>direccion</span></td>
  15.             <td class="fila>"><span>estado</span></td>
  16.             <td class="fila>"><span>municipio</span></td>
  17.             <td class="fila>"><span>ciudad</span></td>
  18.             <td class="fila>"><span>email</span></td>
  19.             <td class="fila>"><span>telefonoCasa</span></td>
  20.             <td class="fila>"><span>telefonoCelular</span></td>
  21.           </tr>
  22.           </tbody>
  23. </body>
  24. </html>