Submit Answers to the Questions
Learn how to submit answers to the trivia questions
Task 12: Allow players to submit an answer to the trivia question
In the client, the trivia form should listen for a submit
event. On submit
, send the player’s answer to the server.
Note: Don’t forget to disable the button after the player has submitted an answer since we don’t want to allow players to submit multiple answers.
- Let’s do that by adding the following code to the
public/js/trivia.js
file:
Get hands-on with 1400+ tech skills courses.