[HELP] Chore Door: Button text doesn't change

Hi guys! Im currently getting some pretty good levels of stress with this problem in particular. I’ve tried looking in CDT already, but it doesn’t show any errors, I also looked the “Get Help” section, but it didn’t make a difference . I have already went through all the JS logic over and over again, but I still can’t find the mistake to fix it. Currently, I’m in topic 58 of the “Chore Door” exercise from “JavaScript Interactive Websites” module and I can’t make the button text change to “GAME OVER! Play again?” when the ChoreBot door is opened before opening all the other doors. Here are the code schemes.

Thanks :smiley:

Hi @luiz_ft

if (numClosedDoors === 0) {
    } else if (isBot(door)) {

You used ‘else if’ for isBot()instead of ‘if’. That means the second statement will only be reached if the first condition is false. But as long as there are closed doors, only the first statement will be entered. Write two ‘if’ conditions instead.

1 Like

Hi, Mirja! Thanks for the help, really appreciate it. I’ve tried doing what you said, but it still doesn’t work, the text still keeps failing to change… I will have to continue on my “wall climb journey” haha

The image path for the bot image is not correct, you forgot the double slashes. If you fix that and remove the else as described above, it should work.

Wow! Thanks a lot! It worked!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.