Generer un nombre aléatoire
Voila, j'ai écris un petit script, et il ne marche pas.
J'ai cherché mon (ou mes) erreur(s) et je n'en ai pas trouvée(j'ai tout manipulé).
Pouvez vous m'aidez svp.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| <html>
<head>
<title>random</title>
</head>
<body>
<p>bonjour</p>
<SCRIPT LANGUAGE="Javascript">
function random(){
x=Math.random();
var a=charAt(x,2);
var b=charAt(x,3);
var c=charAt(x,4);
var d=charAt(x,5);
document.write(a+b+c+d);
}
random();
</SCRIPT>
</body>
</html> |