Finally, use querySelector() to get the #monsterHealth element. Because you have already declared a monsterHealth variable earlier, you need to use a different variable name for this element.
Declare a new variable with the const keyword and name it monsterHealthText.
When i press ‘Check your code’, nothing happens, and if i open it in read-only, it says this: SyntaxError: unknown: Missing initializer in const declaration. (18:23) 16 | const monsterStats = document.querySelector(“#monsterStats”); 17 | const monsterName = document.querySelector(“#monsterName”); > 18 | const monsterHealthText | ^.
This is telling you that you have a syntax error in your code. When you declare a variable as a const then you have to assign it a value at the same time. So my guess is that you aren’t doing that, but can’t be sure without seeing your code.
If you can’t figure it out, please paste your code in here using the following method so that we can see it properly.
To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key. You may also be able to use Ctrl+e to automatically give you the triple back ticks while you are typing in the this editor and the cursor is on a line by itself. Alternatively, with the cursor on a line by itself, you can use the </> button above the editor to add the triple back ticks.
So ya, this you definitely can’t do. There needs to be an equals sign and a value.
This looks right to me. Please try again and if it doesn’t work then paste all of your JS in here. Also, it might help if you reset the step to get the original JS back just to make sure you didn’t accidentally change something you aren’t seeing.
It doesn’t matter how experienced of a developer you are, little typo errors in a page of code can have you putting your head through the wall all day. Keep it up! And I promise, this won’t be the last time you make that mistake!