Skip to content

SujalBirari/JavaScript-Number-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Number Quest - Trivia Adventure

Number Quest is a browser-based trivia game built with vanilla JavaScript, HTML, and CSS. It fetches questions from the Open Trivia DB API and challenges users to answer as many as possible, tracking their score and question number.

Features

  • Dynamic Question Fetching: Uses JavaScript's fetch API to retrieve trivia questions in real time.
  • Randomized Options: Shuffles answer choices for each question using array methods.
  • Interactive UI: Renders questions and options dynamically with DOM manipulation.
  • Score Tracking: Updates and displays the user's score and question number as they play.
  • Immediate Feedback: Highlights correct and incorrect answers using CSS classes.
  • Responsive Design: Styled for usability across devices.

Project Structure

Number Quest - Trivia Adventure/
│
├── index.html                # Main game page
├── scripts/
│   └── script.js             # Core game logic (JavaScript)
├── styles/
│   └── style.css             # Game styling (CSS)

JavaScript Highlights

  • API Integration:
    Fetches questions from Open Trivia DB using asynchronous functions.

  • DOM Manipulation:
    Dynamically creates and updates question, options, and score elements.

  • Event Handling:
    Handles user interactions for answering questions and moving to the next one.

  • State Management:
    Maintains game state (score, number, current question/answers) in JS variables.

How to Run

  1. Clone the repository.
  2. Open index.html in your browser.
  3. Play the game—no build steps or dependencies required!

Customization

Credits


Enjoy challenging your knowledge with

About

Simple Trivia Quiz Game made in JavaScript using the TriviaDB public api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors