Learn Basic JavaScript by Building a Role Playing Game - Step 44

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";
}```

Hi @up695407

For a hint look at lines 21, 22, and 23 of the script file.

Happy coding

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.