Lately, I've been struggling to make my code display questions in a specific order. My goal is to have the next question show up once the submit button is pressed, while hiding the previous one.
Currently, I'm developing a game similar to Family Feud where each question should appear at the top of the screen until the user submits an answer. At this stage, I haven't created a function for submitting answers; my focus has been on making the questions appear and disappear upon clicking the submit button. You can check out my progress so far by following this link:
I managed to hide all the questions except the first one, and after hitting submit, the second question is displayed. However, I'm facing issues with showing the subsequent question while hiding the current one. It seems like both the 2nd and 3rd questions are being shown together instead.
I've experimented with different solutions, including using the toggle method and creating an array called 'questions' to see if that would work. Unfortunately, none of these approaches helped me achieve the desired outcome. Any assistance would be greatly appreciated.
Thank you!