I am making an idle game and want something to be purchased on user click. I have an onclick event connected to it which triggers the buyCreateScript() function but it is not working. Any advice? Fiddle:https://jsfiddle.net/wizviper/m1ftgoyp/82/ Javascript:
function buyCreateScript() {
if(bytes >= createScriptCost ) {
   createScriptAmount++;
   bytes = bytes - createScriptCost;
   createScriptCost = createScriptCost * priceIncrease;
  }
}
HTML:
   <button type="button" class="btn-primary" id="createScript" 
 onclick="buyCreateScript()">Create Script-0</button>
 
     
    