Versuch es mal so
HTML-Code:
<script type="text/javascript">
function reihe(max){
var zahl=1;
while(zahl <= max)
{
document.write(zahl+"<br>");
zahl++;
}
}
</script>
<form name="formular">
<input type="text" name="stinki">
<input type="button" value="schreiben" onClick="javascript:reihe(document.formular.stinki.value)">
So zählt es auch bei der Eingabe von 10 von 1-10 und nicht wie bei Dir von 1-11.
Zusatz:
Es geht aber auch folgendes Script, welches kürzer ist
HTML-Code:
<script type="text/javascript">
function reihe(max){
for(var zahl=1; zahl<=max; zahl++){
document.write(zahl+"<br>");
}
}
</script>