๐ JavaScript Console Quiz Game
This project is a simple interactive quiz built with HTML and JavaScript. The quiz runs through browser prompt() and alert() dialogs, and it only starts when the user clicks a Start Quiz button on the webpage. It showcases fundamental JavaScript concepts such as arrays, loops, functions, conditionals, and external script linking.
๐ Features
Quiz runs inside browser pop-up prompts and alerts
Starts only when the Start Quiz button is clicked
Answers are checked in a case-insensitive and trimmed manner
Real-time feedback after each question
Total score displayed at the end
Neat separation of HTML and JS logic using an external file
Uses an organized array of objects for questions and answers
๐ Project Structure Quiz-Game/ โ โโโ index.html # UI with Start Quiz button (links to JS) โโโ script.js # Main quiz logic โโโ README.md # Project documentation
๐ How to Run
Open index.html in any web browser
Click the Start Quiz button
Answer the questions shown in the prompts
Receive immediate feedback after each response
View your final score in a summary alert
๐ฏ What You Learn
By working on this project, you practice and understand:
Storing multiple questions using arrays
Using objects to pair questions with answers
Looping through questions with a for loop
Organizing code using a function (runQuiz)
Handling user input using prompt()
Displaying output using alert()
Normalizing text with:
toLowerCase()
trim()
Checking correctness using ifโelse conditions
toLowerCase()
trim()
Checking correctness using ifโelse conditions
Author:-
Ayush Kumar