In my game players have a balance and when they click the button it goes down by 5000, they start off with 20,000 when they reach 0, I want an alert to come up (i have that working) and the button to be disabled - I can't get that to work, can anyone shed some light please? All the functions are working perfectly btw I'm just trying to add in the disable button to the "Subtract" Function - Thanks!
here's the code I'm working with
<script type="text/javascript">
function subtract() {
var Balance = document.getElementById("Balance");
var Fee = parseInt(Balance.value) - 5000;
Balance.value = Fee;
if(Fee <= 0){
alert("To Continue Playing - Purchase More Coins at - LINK");
}
}
</script>
<button class="randombutton" id="aaa" style="float:left;" onclick= "
randomImg1();
randomImg2();
randomImg3();
randomImg4();
randomImg5();
randomImg6();
randomImg7();
randomImg8();
subtract();
foo(this);"/>OPEN PACK</button>