1. Home
  2. Computing & Technology
  3. JavaScript

Multiple Fill in the Blanks Quiz

3. Obtain the Script

Join the Discussion

Questions? Comments?

Quizes

Cat Songs

The first step in adding a "multi page fill in the blanks" quiz to your page is to copy the following script and attach it to the head section of your page.

Once you have created your code you just save it to an external javascript file. I called mine quizv.js. You then link it into the head of your page using the following code:

<script type="text/javascript" src="quizv.js">
</script>

Each page of the quiz will load a new page after the quiz is entered and the results from that page as well as overall results so far will be passed to that page where they can be easily displayed. To display the results from the previous page of the quiz you simply add the following code where you want the results to be displayed.

<script type="text/javascript">
document.write('<b>' + stageResult() + '<\/b>');
</script>

Similarly you can display the overall total so far using:

<script type="text/javascript">
document.write('<b>' + finalResult() + '<\/b>');
</script>

Now all that remains is to create your text for each quiz page complete with drop down lists.

Introduction | Sample Pages | Obtain the Script | Add the dropdowns
Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.