title: Dynamic button javascript
body: <p>had a look for a guide on this but couldn't really find anything specific on it, and thought you guys could help.</p>
  
  <p>I have a javascript file which performs various tasks onLoad. Currently I have 5 buttons in an HTML page but what I would like to do is to is read from an array in the js file and dynamically create a number of buttons depending what was in the array.</p>
  
  <p>Similarly I want the buttons on click to be 'listened' for (alter an array in the js) </p>
  
  <p>I have an idea that I want to read the array elements and set them as the button IDs and create them. Likewise I want to listen to what button has been clicked by its ID and have it alter an array. But how do I actually go about that process?</p>
  
  <p>Cheers</p>