+ 4
function Func3(){ if(countEn >= 20){ // You need to subtract 20 from countEn and save that value back into countEn countEn -= 20; // Then you can just set 'energy' to that value and when 'energy' is clicked the value will increase as it should document.getElementById('energy').innerHTML = countEn; document.getElementById('coin').innerHTML = ++countMo; } }
22nd Dec 2017, 9:12 PM
ChaoticDawg
ChaoticDawg - avatar