I am currently struggling to create the onclick property update for this question.
function goStore() {
button1.innerText = "buyHealth";
button2.innerText = "buyWeapon";
button3.innerText = "goTown";
}
I am currently struggling to create the onclick property update for this question.
function goStore() {
button1.innerText = "buyHealth";
button2.innerText = "buyWeapon";
button3.innerText = "goTown";
}
Have you tried anything? You have correctly ‘created’ properties called innerText
here. It’s the same idea when creating the onclick
property
i added it in with the gostore function
function goStore() {
button1.innerText = "Buy 10 health (10 gold)";
button2.innerText = "Buy weapon (30 gold)";
button3.innerText = "Go to town square";
button1.innerText = "buyHealth";
button2.innerText = "buyWeapon";
button3.innerText = "goTown";
}```
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.