JS CSS : impossible de styler un href ?
Salut,
Voil� un truc de ouf : pourquoi est-il impossible, via JavaScript, de r�cup�rer la valeur de l'attribut color d'une balise href ?
8O
Comment faites-vous ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <!DOCTYPE html>
<head>
<title>TEST</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script>
function monalerte(coucou) {
var toto = document.getElementById(coucou).style.color ;
alert(toto);
}
</script>
<style>
a:link, a:active, a:visited {color:black;}
a:hover {color:rgb(000,000,255);}
</style>
</head>
<body>
<a href="#" id="monid" onMouseOver="monalerte(this.id);">mon lien</a>
</body> |
Merci.