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

Tell us what’s happening:

what could be the issue with my code at this point?

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/124.0.0.0 Safari/537.36

Challenge Information:

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

I think the language in the lesson is throwing you off a bit, but think about what you’re trying to achieve. The lesson wants you to update the innerText of the monsterName element so that it displays what you are currently fighting in the monsters array, not to update the array to take the value from the innerText. Try to code it to do that, and try submitting again (and update the monster’s health appropriately too).

I do not still get it

HI @Bouff_Daddy

Start by assigning monsters[fighting].name to the innerText property of monsterName. Then, assign monsterHealth to the innerText property of
monsterHealthText.

You should assign monsters[fighting].name to monsterName.innerText.

  1. The order of the code needs fixing up.
  1. The code and the order of the code needs fixing up.

You placed your assigning value on opposite side.

Instructions for the step is:
Start by assigning monsters[fighting].name to the innerText property of monsterName. Then, assign monsterHealth to the innerText property of monsterHealthText.
@Bouff_Daddy

Thank you. Resolved.

Your welcome, happy Coding.