+ 1
[COMPLETED] The button is pressed the second time
Hi, I wanted to create a theme switch button for my site, but for it to switch the first time, you need to click twice, and then everything works fine from the first, what's the problem, how to fix button? Code: https://code.sololearn.com/Wf5haWLD4WR2/?ref=app
3 Respostas
+ 1
Michael, thank you for your help and participation
0
You have to swap the call of brightTheme and darkTheme in your click function.
0
Bedrock Coder, thanks a lot 😄
I couldn't find the cause for three days, and it turns out it's so simple, thank you very much!