+ 1
Help me pls !
In this code I am making kinda quiz game.But the problem is in the Javascript side.When you guessed first one correctly and jump to the second one,whatever you guess(even true) the output is always "Wrong !".You will see the problem in this code.Which thing I have written wrong?Help me pls. https://code.sololearn.com/Wob4Tz21PIIb/?ref=app
6 Answers
+ 1
Line 5 and line 17 both are adding click event listener to the same button.
When the first question is done, the first event listener is not removed and is still effective.
One of the way is to use jQuery off function to remove the click event listeners each time the question is answered correctly.
https://code.sololearn.com/Wm032MywK3IB/?ref=app
+ 2
Tbh I'm not sure, ur using jquery right ? đ€đ€đ€
Ps. I suggest you tidy up your code a bit. It looks somewhat messy on mobile. No offence man
Really like you code though đ
+ 2
Yeah I know, sorry abt that. It looks like it should work but I have the same question. I haven't used jquery yet so I'm somewhat clueless. Good luck though đđ
+ 2
Interesting way to use flags in if.
By the way, you may want to read this JavaScript code styling guide:
https://www.sololearn.com/post/122691/?ref=app
+ 1
Minerals2016 tidying up... is not solution but thank u anyways;)
0
@Gordon thanks for code.I appreciated for that.I make little changes on this code .Final code:
https://code.sololearn.com/WiYSCmNOg4x1/?ref=app