+ 1

HELP! Why isn’t my javascript code working?

Objective: 1. I want to set the variable “name” = the user’s input after asking for the name of the koala. I’m not sure if I did it right. 2. After the function Name() runs, then I want to change the <h1> to the name of the koala. Can someone tell me why the header isn’t changing to the name of the koala? https://code.sololearn.com/We4BFeQJk50E/?ref=app

17th Feb 2020, 9:02 PM
tori the crafter 💛
tori the crafter 💛 - avatar
5 Respuestas
17th Feb 2020, 10:08 PM
Cmurio
Cmurio - avatar
+ 5
Yes, is equal a document.getElementById("printName").innerHTML=name;
17th Feb 2020, 10:15 PM
Cmurio
Cmurio - avatar
+ 1
Here is an example based on your code https://code.sololearn.com/WLb7mGMV4WLO/?ref=app
17th Feb 2020, 10:03 PM
Gabriel Ilie
Gabriel Ilie - avatar
+ 1
The condition firstFunction === true is executed before your function Name()
17th Feb 2020, 10:07 PM
Gabriel Ilie
Gabriel Ilie - avatar
0
Jesus Eduardo Canul Koyoc thank you so much! Is ‘n’ a variable?
17th Feb 2020, 10:13 PM
tori the crafter 💛
tori the crafter 💛 - avatar