CitationTu n'obtiens pas ce que tu cherches, ok, mais tu obtiens quoi au juste?
h1.style.color = CouleurAlea();
h1.style.color = Couleur_Alea();
<h1 id="Toufan" > Couleurs aléatoires </h1>
<script language=javascript type=text/javascript> function Couleur_Alea() { var rouge = Math.round( Math.random() * 255); var vert = Math.round(Math.random()* 255); var bleu = Math.round(Math.random()* 255); return ('rgb('+rouge+','+vert+','+bleu+')') } function TexteAlea() { var h1 = document.getElementById("Toufan"); h1.style.color = Couleur_Alea(); h1.style.fontSize = "18pt" } </script> <html> <head> </head> <body onload="TexteAlea()";> <h1 id="Toufan" > Permier Appel : Couleurs aléatoires </h1> <br> <h1 id="Toufan" > Couleurs aléatoires </h1> </body > </html>
Web analytics