Hi,
The following loop works:
But the following doesn't:Code:<html> <body> <script type="text/javascript"> var i=0; for (i=0;i<=5;i++) { document.write("The number is " + i); document.write("<br />"); } </script> </body> </html>
I'd just like to create a simple variable.Code:<html> <body> <script type="text/javascript"> var i=0; var x="i=0;i<=5;i++" for (x) { document.write("The number is " + i); document.write("<br />"); } </script> </body> </html>
Please bear with me as I'm a newbie in JavaScript and let me know what I'm missing.
Many thanks in advance!
Rain Lover



Reply With Quote

Bookmarks