A mountain bike multiple choice JavaScript quiz application.
The purpose of this project was to learn how to develop a simple quiz application using HTML, CSS and JS. I have a deep passion for mountain biking and thought it would be fun to create a quick quiz for other fellow mountain bikers and subscribers of the channel GMBN.
Users should be able to:
Select from 10 multiple choice questions and proceed onto the next question. At the very end they will be presented with their score out of 100.
Above is what you should see when you click on the link below.
- HTML5 markup
- CSS custom properties
- CSS Grid
- Vanilla JavaScript
- How to use the onclick event attribute to load a new question.
- How to create an array of obects for the questions in JavaScript.
- I learnt how to manipulate the DOM by using the method document.getElementById.
- Use if statements to specify a block of code to be executed, if a specified condition is true.
- Make a CSS grid container for question options.
Here are some code snippets I am proud of:
//Hide the container to reveal the score after final question
if(currentQuestion == totalQuestions){
container.style.display = "none";
resultCont.style.display = "";
resultCont.textContent = `Your Score: ${score}/100`;
return;
}
- MDN - getElementById() - This helped me understand how getElementById() is used when you want to manipulate, or get info from, an element on your document.
- freeCodeCamp - Array of Objects - This was useful in understanding how to create an array of objects. I learnt that they are used to store multiple values in a single variable.
Project is: in progress
- Website - Max Lockwood