This is my code:
goldText.innerText = Gold: ${gold};
healthText.innerText = Health: ${health};
I have made numerous google searches and quite seem to appear to make the correct answer. Please can someone help me make the correct answer to extend to no more than two lines.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
function buyHealth() {
gold -= 10;
health += 10;
}
// 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/126.0.0.0 Safari/537.36 Edg/126.0.0.0
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 76
For this step you can assign just the variable to the .innerText property.
If you look at the preview, the text for Gold and Health are already on the page.
Am I getting close? I am still a little confused by what you mean. I am almost there.
gold.innerText = "Gold: ${“Go to store”};
health.innerText = "Health: ${“Buy Health”;
After your assignment lines, assign the innerText property of goldText to be the variable gold. Use the same pattern to update healthText with the health variable.
You must do only what this says and absolutely nothing more.