LESSON 09 – POP UP BOXES

 

WORK

 

QUESTION 1

 

The following code redirects your browser to the URL that is inside quotes:

 

window.location = "http://www.google.com/";

 

Using a confirm pop up box, ask the user to “Hit OK to be redirected to Google.”  If the user hits OK, then the browser goes to google.  Otherwise, it simply shows a message such as “So you decided to stay on this page eh.”

 

QUESTION 2

 

Make use of the prompt pop boxes to create a small 10 question quiz.  The user will simply be prompted for each question and will simply type in an answer.  You will check if the answer is correct and keep track of correct scores.

 

At the end, you will display a message stating the amount of correct answers that were given.  You should also have a description message such as “You rock” or “You suck” based on their score.

 

Example

 

Click here to see an example of a quiz that has been started.  Use View Source to see the code.