+ 1

What's wrong with this code?

I'm practicing JS as a newbie and I'm not quite sure why it's not working. I feel like I have most of it right but I don't understand the code it gives me when I run it. https://code.sololearn.com/WtB1jp3e520e/?ref=app

1st Oct 2020, 3:12 AM
Jesse Douglas
Jesse Douglas - avatar
5 Respostas
+ 3
Use window.onload event to get result you can see javascript line 5 in my code to understand https://code.sololearn.com/W651nnd2UcSf/?ref=app
1st Oct 2020, 3:32 AM
Mask Man(What's in a name?)
Mask Man(What's in a name?) - avatar
+ 1
You can use javascript Onload event to work fine
1st Oct 2020, 12:29 PM
Mask Man(What's in a name?)
Mask Man(What's in a name?) - avatar
0
Do I always have to run window.onload for the JavaScript to work properly or is that just a SoloLearn type of thing I have to do because of how they set it up?
1st Oct 2020, 12:01 PM
Jesse Douglas
Jesse Douglas - avatar
0
Also... My function changeColor doesn't seem to be working either and I'm not sure if it needs to be defined inside or outside window.onload or if I need to change up the syntax?
1st Oct 2020, 12:03 PM
Jesse Douglas
Jesse Douglas - avatar
0
Jesse Douglas check again my code
1st Oct 2020, 12:28 PM
Mask Man(What's in a name?)
Mask Man(What's in a name?) - avatar