Why this code is not working properly? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why this code is not working properly?

https://code.sololearn.com/WaBBQzDkwiLs/?ref=app (This code is collected. I just changed the value of id. And then it is not working.) Is the value of ID is invalid?

5th Sep 2021, 11:05 AM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar
3 Answers
+ 3
What's not working? What do you expect it to do? I'm gonna guess and say that you don't want the second div displayed until after the setTimeout has finished. If that is the case you need to set the display type for the second div to none as its initial setting. You can do this with a little CSS. Put the following in your CSS tab and run it. #a2 { display: none; }
5th Sep 2021, 11:16 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
It's ok to be a noob, we all were at some point! Just try to be a bit more thorough when asking your questions. Give examples and be as clear as you can about what you need help with. You will get much better answers much quicker if you ask really detailed questions with explanations of what you're expecting and what is happening. Give example inputs, outputs, errors etc. The more we have to look over, reformat, and diagnose what we think your issues may be the more likely we will just pass and go on to a better asked question. Good luck and enjoy coding.
5th Sep 2021, 11:30 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
Thank you ChaoticDawg 😍 Actually I'm very noob in Javascript 😅. Trying to learn.
5th Sep 2021, 11:24 AM
Fꫀⲅძ᥆͟ᥙ᥉᯽
Fꫀⲅძ᥆͟ᥙ᥉᯽ - avatar