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

Tell us what’s happening:

I’m being told to: " Display the monsterStats element by updating the display property of the style property to block. For example, updating the first property of the name property of user would look like:

user.name.first = "Naomi";
```"

But I don't understand how I know what the "user", "name" or "first" would be in my CSS
### Your code so far
CSS:
#monsterStats {
  display: none;
  border: 1px solid #0a0a23;
  padding: 5px;
  color: #ffffff;
  background-color: #c70d0d;
}

JS:
function goFight() {
  update(locations[3]);
  monsterHealth = monsters[fighting].health;
  style.monsterStats.display = block;
}

### Your browser information:

User Agent is: <code>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36 Edg/120.0.0.0</code>

### Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 117
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-117

Can you provide a link to the challenge

Learn Basic JavaScript by Building a Role Playing Game: Step 117 | freeCodeCamp.org

Here your code:

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

Your code should look like this:
document.getElementById("myDIV").style.display = "none";
Here the link as reference: HTML DOM Style display Property. In this case document.getElementById("myDIV") you can replace with monsterStats and the other thing is your block should be string;

1 Like