Another useful programmiing structure is the loop. JavaScript provides several ways to repeat commands easily. Let's start with the for loop. The following html was written with JavaScript.
In this example, you will place the loop under an if statement. If user enters a valid number (1 or greater), then run the loop. Else, display a not-so-friendly message.