Tell us what’s happening:
This is the output i get.
Your buyHealth
function should update the text of healthText
to be the value of health
.
Your code so far
function buyHealth() {
gold -= 10;
health += 10;
const healthText = document.querySelector('#healthText');
healthText.innerText = health;
const goldText = document.querySelector("goldText");
goldText.innerText = gold;
}
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Challenge Information:
Learn Basic JavaScript by Building a Role Playing Game - Step 75