Thanks:
Here is my code. I want to enter a positive number and print out from zero to that number.
[HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD><SCRIPT language="JavaScript" type="text/javascript">
var i= prompt('Please enter a positive integer:', ' ');
</script>
<TITLE>CSL1</TITLE>
<META NAME="GENERATOR" CONTENT="MAX's HTML Beauty++ 2004">
</HEAD>
<BODY><h3>I should be able to enter 10000 and it should
print 1,2,3,....10000<P>
1.Prompt the user for a positive integer.<P>
2.Print the numbers from
<U>zero to that number</U> in the web page, each number on a separate line.<P>
3.You do not have to do data validation. You can assume the user will actually give you a positive integer.<P>
You do not have to worry about over writing the page with your results.<P></h3>[/html]
- <script type="text/javascript">
-
for (i = 0; i <1000; i++)
-
{
-
document.write(i)
-
document.write("<br />")
-
}
-
</script><P>
-
-
-
-
<SCRIPT language="JavaScript" type="text/javascript">
-
> //var x= prompt('Please enter a positive integer:', ' ');
-
> </script>
-
> <TITLE>CSL</TITLE>
-
>
-
> <SCRIPT language="JavaScript" type="text/javascript">
-
>
-
> /*if (x ==0)
-
> {
-
> document.write(0+ ' <BR> ');
-
>
-
> }
-
> else if (x ==2)
-
> {
-
> document.write(0+ ' <BR> ' + 2 + '<BR> ');
-
>
-
> }
-
> else if (x ==4)
-
> {
-
> document.write(0+ ' <BR> ' + 2 + '<BR> ' + 4 + '<BR>');
-
>
-
> }
-
> else if (x ==6)
-
> {
-
> document.write(0+ ' <BR> ' + 2 + '<BR> ' + 4 + '<BR>' + 6 +
-
> '<BR>');
-
>
-
> }
-
> else if (x ==8)
-
> {
-
> document.write(0+ ' <BR> ' + 2 + '<BR> ' + 4 + '<BR>' + 6 +
-
> '<BR>' + 8 + '<BR>');
-
>
-
> }
-
> else if (x ==10)
-
> {
-
> document.write(0+ ' <BR> ' + 2 + '<BR> ' + 4 + '<BR>' + 6 +
-
> '<BR>' + 8 + '<BR>' + 10 + '<BR>');
-
>
-
> }
- </script>
-
> </BODY>
-
> </HTML>
-
-
-
-
</BODY>
-
</HTML>