Make sure to nest your JQuery library into the tag.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
For each of the test questions, use conditionals to check whether the correct answer was provided by the user. The click handlers for each question have been provided for you (except for the last question). Go through each question, and do the following:
-
English : Write an if/else conditional statement to check if the value of the variable englishInput is correct (the answer should be Mon).
-
Social Studies : Write an if/else conditional statement to check if the value of the variable ssInput is correct (the answer should be Albany). If it is correct, use .text() to display a message in the div with the ID ssMessage. (Hint: refer to the code in the previous question)
-
Math : Write an if/else conditional statement to check if the value of the variable mathInput is correct (the answer should be the number 30). If it is correct, use .text() to display a message in the div with the ID mathMessage.
-
Science: Write a click handler for the button in the science question (refer to the HTML for the ID of the button). Create a variable that stores the value of the input in the science question. Then write an if/else conditional statement to check if the value of the variable you created is the correct answer (the answer is solid). If it is correct, use .text() to display a message in the div with the ID scienceMessage. (Hint: refer to the code in the previous questions for guidance)
If you finish early: When a student gets the answer right, make it so their answer turns green. If they get it wrong, make their answer turn red. Also, add some images to each of the subject lines and change the background.
*Don't forget to hit submit when you're finished!