Webpage to answer trivia questions. CS50 Problem Set 8.
![Trivia](https://private-user-images.githubusercontent.com/84383847/308724511-6eb1c939-b673-4934-b30b-64367c04ce3a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjUyNjcxMjQsIm5iZiI6MTcyNTI2NjgyNCwicGF0aCI6Ii84NDM4Mzg0Ny8zMDg3MjQ1MTEtNmViMWM5MzktYjY3My00OTM0LWIzMGItNjQzNjdjMDRjZTNhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTAyVDA4NDcwNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM3MDZkMmM5MGVlNTdiZGM4MjZhMjRhY2JlNmQyZWYyYTU1MGFhOTY2Njg3MjgyYjM3OTkzMGVkNmY4ODhmZmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.YQOWqjVmQPbHTAgfroF4CACw7s_HR0PWZ8-NGE7Huzw)
Design a webpage using HTML, CSS, and JavaScript to let users answer trivia questions.
- In
index.html
, add beneath “Part 1” a multiple-choice trivia question of your choosing with HTML.- You should use an
h3
heading for the text of your question. - You should have one
button
for each of the possible answer choices. There should be at least three answer choices, of which exactly one should be correct.
- You should use an
- Using JavaScript, add logic so that the buttons change colors when a user clicks on them.
- If a user clicks on a button with an incorrect answer, the button should turn red and text should appear beneath the question that says “Incorrect”.
- If a user clicks on a button with the correct answer, the button should turn green and text should appear beneath the question that says “Correct!”.
- In
index.html
, add beneath “Part 2” a text-based free response question of your choosing with HTML.- You should use an
h3
heading for the text of your question. - You should use an
input
field to let the user type a response. - You should use a
button
to let the user confirm their answer.
- You should use an
- Using JavaScript, add logic so that the text field changes color when a user confirms their answer.
- If the user types an incorrect answer and presses the confirmation button, the text field should turn red and text should appear beneath the question that says “Incorrect”.
- If the user types the correct answer and presses the confirmation button, the input field should turn green and text should appear beneath the question that says “Correct!”.
Optionally, you may also:
- Edit
styles.css
to change the CSS of your webpage! - Add additional trivia questions to your trivia quiz if you would like!