How to use the onclick button option

In your goStore() function, update the onclick property for each button to run buyHealth , buyWeapon , and goTown , respectively.

how can i do this please

if you have an element saved in a variable myButton you can update the onclick property to run a function func writing myButton.onclick = func

thank you
it was helpful

1 Like

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