Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/03/2006, 13:40
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Hola sergiold y caricatos

Echar un vistazo a este código a ver si es lo que se busca:
Código:
<html>
<head>
<style type="text/css">
#capaEspecifica a{
color: #FF0000;
}
#capaEspecifica a:hover{
color: #FFCC00;
}
</style>
<script type="text/javascript">
function cambiar(regla,propi,valor) {
  if (document.all)
    miRegla = document.styleSheets[0].rules;
  else
    miRegla = document.styleSheets[0].cssRules;
  for (i=0; reg=miRegla[i]; i++)
    if (reg.selectorText.toLowerCase() == regla.toLowerCase() )
      reg.style[propi]=valor;
}
</script>
</head>
<body>
<div id="capaEspecifica">
<a href="#">Enlace</a>
<a href="#">Enlace</a>
</div>
<input type="button" value="Cambiar color" onclick="cambiar('#capaEspecifica a','color','blue')" />
<input type="button" value="Cambiar hover" onclick="cambiar('#capaEspecifica a:hover','color','green')" />
</body>
</html>
Saludos,