In the spirit of the Old MacDonald page you wrote in Chapter 9, create a Web page

Question:

In the spirit of the "Old MacDonald" page you wrote in Chapter 9, create a Web page named bottles.html that displays verses of the song "100 bottles of Root Beer on the Wall" (you may insert your favorite beverage). The page should contain a text box in which the user can enter the initial number of bottles. You should also provide a button that, when clicked, calls a function to display (in a page division) the sequence of verses starting with the specified number of bottles. For example, if the user entered the number 100, your page might display:

100 bottles of root beer on the wall.

100 bottles of root beer.

Take one down, pass it around.

99 bottles of root beer on the wall.

99 bottles of root beer on the wall.

99 bottles of root beer.

Take one down, pass it around.

98 bottles of root beer on the wall.

...

1 bottle of root beer on the wall.

1 bottle of root beer.

Take one down, pass it around.

0 bottles of root beer on the wall.

[The variable that drives your loop test should be initialized to the number of bottles entered by the user and then decremented during each iteration of the loop. Within the loop body, include statements that display the verse associated with the variable's current value.]

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: