Learn Basic JavaScript by Building a Role Playing Game - Step 133

Tell us what’s happening:

Hey everyone, kindly walk me through on this. The instruction is below;
" After a monster is defeated, the monster’s stat box should no longer display.

On the first line of the update function, use monsterStats.style.display to change the display value to none."

my current code is below;

function update(location) {
  monsterStats.style.display = none;
  button1.innerText = location["button text"][0];
  button2.innerText = location["button text"][1];
  button3.innerText = location["button text"][2];
  button1.onclick = location["button functions"][0];
  button2.onclick = location["button functions"][1];
  button3.onclick = location["button functions"][2];
  text.innerText = location.text;
}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15

Challenge Information:

Learn Basic JavaScript by Building a Role Playing Game - Step 133

1 Like

I’m not sure why but you need quotation marks. :slightly_smiling_face:

6 Likes

Hi @Answer_Alyosha

Since the value is text, it needs to be wrapped in quote marks.
Otherwise JavaScript will treat it like a variable.

Happy coding

4 Likes

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