Interactive Quiz
What is it?
An exercise that takes you through the steps to make an interactive quiz, using HTML, CSS and JavaScript.
Why should I learn it?
You've learned a lot of different skills with HTML, CSS and JavaScript. Now it's time to pull it all together for a more comprehensive project.
What can I do with it?
This is just one exercise that demonstrates what you can do with an interactive website. From here, you can manipulate the code for your own purposes and start thinking about how you'd create your own interactive projects.
How long will it take?
Programming is something that you learn over time, through practice. This exercise will take a few hours, but you will need to spend some time working with these skills after you complete it.
Resources
- Glitch examples for you to Remix
- LinkedIn Learning
- Codecademy
- JavaScript Reference
- Book: JavaScript and JQuery: Interactive Frontend Web Development
Getting Started
We are going to be working on a page that will ultimately contain an interactive quiz. To start, we will create the page with the questions. We’ll then add the form elements. Later, we’ll make it interactive, so it can score the quiz. While we're at it, we'll use the quiz content to refresh your memory on some JavaScript concepts.
Let's begin with a basic HTML page to get us started.
Name it anything you want, as long as it has an .html extension. Open this page in a browser. See how it looks. Right now, it’s just basic text.
If you want to use the images I used in this tutorial, you can find them here, but feel free to use any images you want in creating your own projects. Be creative! For your own Interactive Quiz Project, you will be developing the quiz in a Bootstrap-enabled page.
Basic CSS
Add the CSS code to the right to the head of the document, so you can start designing the page. Make sure you enclose the styles within the opening and closing styles element We'll be creating the divs for main and header next.
I have added an image to fit in the head of the document, that you can find here, if you'd like to use it. Feel free to use another image or style the heading section in a different way, if you want.