<html> <head> <style TYPE="text/CSS"> <script language="Javascript"> function Couleur_Alea() { var rouge = Math.round( Math.random() * 255); var vert = Math.round(Math.random()* 255); var blue = Math.round(Math.random()* 255); return ('rgb('+rouge+','+vert+','+bleu+')') } </script> H1{font-family: arial, verdana,Palatino; font-size: 13pt; color: Couleur_Alea(); text-align: left; } </style> </head> <BODY> <H1> Couleurs aléatoires </H1> </BODY> </html>
Citationvar blue = Math.round(Math.random()* 255); return ('rgb('+rouge+','+vert+','+bleu+')')
color: Couleur_Alea();
<html> <head> <style TYPE="text/CSS"> <script language="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 = "CouleurAlea();" h1.style.fontSize = "18pt" } </script> </style> </head> <BODY> <form> <h1 id="Toufan"> Couleurs aléatoires </h1> </form> </BODY> </html>
h1.style.color = "CouleurAlea();"
h1.style.color = CouleurAlea();
<html> <head> <style TYPE="text/CSS"> <script language="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 = CouleurAlea(); h1.style.fontSize = "18pt" } </script> </style> </head> <BODY> <font color="TexteAlea();"> <h1 id="Toufan" > Couleurs aléatoires </h1> </font> </BODY> </html>
<font color="TexteAlea();">
<body onload='TexteAlea();'>
<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 = CouleurAlea(); h1.style.fontSize = "18pt" } </script> <html> <head> </head> <body onload="TexteAlea()";> <h1 id="Toufan" > Couleurs aléatoires </h1> </body > </html>
Web analytics