Fetches questions from a public API and renders them on the page using JavaScript. The game allows you to select answers and keeps track of your score. The project utilizes async/await for retrieving data from the API and DOM manipulation for rendering questions and answers.
- To run the quiz game locally, follow these steps:
https://github.com/AnamolZ/API_DataFetching_JS.git
- Navigate to the project directory:
cd API_DataFetching_JS-main
- Open the index.html file in your preferred web browser.
- The quiz game will automatically fetch a CS-related question from a public API and display it on the page.
- Read the question carefully and choose the correct answer among the provided options.
- Click on the chosen answer to submit your selection.
- The game will display whether your answer was correct or incorrect. The correct answer will be highlighted.
- The score will be updated accordingly, with each correct answer contributing to your total score.
- The game will continue to the next question automatically.
- After answering 10 questions, the game will display your final score.
- Fetches CS-related questions from a public API.
- Renders questions, answers, and score on the page using DOM manipulation.
- Tracks the number of correct answers and displays the final score.
- Utilizes async/await for asynchronous data retrieval.
- Utilizes event listeners to handle button clicks.
- Utilizes destructuring for extracting relevant data from API response.
This project fetches questions from the Open Trivia Database, specifically the following API endpoint:
If you would like to contribute to the quiz game, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature
- Make your changes and commit them:
git commit -m 'Add your feature'
- Push to the branch:
git push origin feature/your-feature
- Create a pull request on GitHub.
Open Trivia Database for providing the API used in this project.