Hans: document.write in funktion

Beitrag lesen

also es wird eine neue Seite geöffnet und Hallo ausgegeben.

Code:
<html>
<head>
<style type="text/css">
<!--
body,input {
 font-family: Tahoma;
 font-size: 10pt;
 text-align: left;
}
--></style>
<script language="javascript">
<!--
var eingabe,i;

function schleife()
{
eingabe = formular01.eingabe.value;
i = 0;
while (i < eingabe)
{
document.write ("Wiederholung<br>");
i++;
}
}
//-->
</script>
</head>

<body style="background-color: #FFEEDD;">

<form name="formular01">
<b>Wiederholungsanweisungen</b><br>
<br>
Anzahl der Wiederholungen:<br>
<br>
<input style="background-color= #DDDDFF; text-align: center;" size="4" name="eingabe" maxlength="4" type="text" value="">
<input style="background-color= #DDDDFF; text-align: center;" name="button01" type="button" value="Start" onclick="schleife()"><br>
</form>
</body>
</html>