JavaScript: Exemplo de uso do for
From AdonaiMedrado.Pro.Br
Revision as of 22:25, 12 September 2008 by Adonaimedrado (Talk | contribs) (New page: <code language="html"> <html> <head> <title>Minha Pagina</title> </head> <body> <script> var i = 0; while(i<10) { document.write("<input type=\"text\" id=\"txtTeste" + i + "...)
<html>
<head>
<title>Minha Pagina</title>
</head>
<body>
<script>
var i = 0;
while(i<10)
{
document.write("<input type=\"text\" id=\"txtTeste" + i + "\"" + ">");
document.write("<input type=\"button\" id=\"btOK" + i + "\"" + " value=\"OK\">");
document.write("<br />");
msg = prompt("Digite seu texto.","Seu texto");
document.getElementById("txtTeste" + i).value = msg;
i++;
}
</script>
</body>
</html> code>