Tell us what’s happening:
In this JavaScript code snippet, we are accessing the HTML element representing the monster’s stats, typically identified by its id
attribute as “monsterStats”.
Once we have a reference to this element, we proceed to update its display
property. The display
property in CSS determines how an element is rendered on the page. By setting it to 'block'
, we are instructing the browser to render the monsterStats
element as a block-level element, which typically means it will appear on its own line and take up the full width available.
Your code so far
const monsterStats = document.getElementById(‘monsterStats’);
monsterStats.style.display = ‘block’;
WARNING
The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.
You will need to take an additional step here so the code you wrote presents in an easy to read format.
Please copy/paste all the editor code showing in the challenge from where you just linked.
Replace these two sentences with your copied code.
Please leave the ``` line above and the ``` line below,
because they allow your code to properly format in the post.
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 115