récupèrer plusieurs variables
Bonjour,
J'ai un probleme pour récupèrer une variable en boucle que je rentre dans une fenètre Prompt.
Voici le code il sagit de la variable "a"
Merci d'avance
8-)
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| <html>
<head>
<SCRIPT LANGUAGE=JavaScript>
function calcul()
{
var n=(prompt("Entrez la quantité :",n));
for(i=1 ; i<=n ; i++)
var a=(prompt("Entrez nombres N° :"+i+"" ))
wdow=open("","","height=820,width=450","scrollbars=1");
wdow.document.write("");
wdow.document.writeln("Nombre d'entrée = "+n+"");
wdow.document.writeln("<br>");
for(i=1 ; i<=n ; i++)
{
wdow.document.writeln("<BR>"+"Nombres N° "+i+"","=",++a);
}
}
</SCRIPT>
</head>
<body>
<form name="formu">
<table border="0" width="100%">
<tr>
<td width="33%"></td>
<td width="34%"><center><INPUT TYPE=button ONCLICK="calcul( );" VALUE="Calculer"></center></td>
<td width="33%">
</td></tr></table>
</form>
</body>
</html> |