I can't figure out why my reset button does not work on this app

A Pen by Trenton (codepen.io)

so, I’m nearing the end of an old project I was working on and I can’t seem to reset the app correctly.

if you fail the quiz a reset button will display allowing you to reset the quiz. However, the functionality of the buttons do not work after the quiz is reset. I can’t figure out what the problem is here. Any hints would be greatly appreciated!

Yeah, I know about that one. Just fail an answer on purpose to get to the reset.

Your reset button creates html with a new button that needs to be clicked to start the quiz. The new button does not have an event listener attached to it.

I would strongly recommend you rethink your quiz design here. You already have everything set up (html and event listeners) when the page loads. Instead of constantly overwriting the inner HTML of quizBoardContainer, I would create a separate element that displays the questions and then hide/unhide it. Then, for each question, you would just update the h1, the span containing the seconds left, the h2 containing the question, and the span which shows the correct answers value.

1 Like

Yeah, this project is giving me all kinds of problems. Thanks for the advice :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.