In this exercise, you will write a FOR loop which throws up an alert dialog box three times.
1. Create an HTML page. Place a SCRIPT tag inside the HEAD of your page. Place one function inside the SCRIPT tag; this function should contain a FOR loop which repeats itself three times. Each time through the FOR loop, an alert dialog box should pop up, displaying the number contained in the local counter variable for the loop.
2. Place a link inside the BODY of your HTML page, calling your function. Test your page. Make corrections, as needed.
View Possible Solution.
Copyright © 2001 Michael Masumoto. All Rights Reserved.