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

Tell us what’s happening:

function goFight() {
update(locations[3]);
monsterHealth = monsters[fighting].health;
monsterStats.style.display = “block”;
monsters[fighting].name = monsterName.innerText;
monsterHealth = monsterHealthText.innerText;
}

It keeps saying:
“You should assign ‘monsters[fighting.name]’ to ‘monsterName.innerText’.”

What do I do here to fix this error?

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

function goFight() {
  update(locations[3]);
  monsterHealth = monsters[fighting].health;
  monsterStats.style.display = "block";
  monsters[fighting].name = monsterName.innerText;
  monsterHealth = monsterHealthText.innerText;
}

// User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36

Challenge Information:

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

check which side of the equal sign your values should be on

1 Like

You need to assign monster [fighting].name to monster name.innerText.

You did opposite of it.
@CoderZENNXX

Thank you so much. I got it now.