Ver Mensaje Individual
  #3 (permalink)  
Antiguo 17/12/2011, 09:19
sebacomas
 
Fecha de Ingreso: mayo-2010
Mensajes: 414
Antigüedad: 14 años
Puntos: 2
Respuesta: cambiar color a link

Hice el siguiente codigo pero no me funciona:


<head>
Código Javascript:
Ver original
  1. <script type="text/javascript">
  2.  
  3. function color(){
  4.  
  5. document.write(location.href).style.color="#FF9900";;
  6.  
  7.  
  8. }
  9.  
  10. </script>

</head>

Código PHP:
Ver original
  1. <body>
  2.  
  3. <?php
  4.  
  5.     $fila=mysql_fetch_array($rs);
  6.    
  7.    
  8.    
  9.     echo "<div class='caja-titulos-obras'>";
  10.    
  11.     while ($fila!=NULL){
  12.    
  13.         $nombreDeImagen=$fila["nombre_de_imagen"];
  14.         echo  "<a onclick='color()' class='vinculo-titulo-obras' href='ver-imagenes-es.php?nombre-de-imagen=$nombreDeImagen&grupo=$grupo'>".$fila["nombre_de_imagen"]."</a><br />";
  15.         $fila=mysql_fetch_array($rs);
  16.        
  17.     }
  18. echo "</div>";
  19.  
  20. ?>
  21.  
  22. </body>