- First, your buttons each need an id and the button's numerical value could be it (like id='8')
- Next, you convert you string in whatever manner you wish to a list of the individual character.
- Then you give each button a click event to do whatever it is you want to do.
- Finally, loop through the list and execute the click events in code
Now all of this can be found, depending upon where you short fallings in this are, at
W3Schools Online Web Tutorials[
^] as various tutorial which you may need: HTML, JavaScript, DOM .