Hi guys,
I have a program that works fine, but I would like to add another check to the code. I want the user to only be able to enter numbers from 0-99. Can anyone suggest how I would do that. Any help is greatly appreciated.
Thanks
Code:
function totalCost(){
    //declare variables
    var snicker = parseInt(document.getElementById("snicker").value);

    var twix = parseInt(document.getElementById("twix").value);
    var chips = parseInt(document.getElementById("chips").value);
    var salesTax = 0.05;
    var total = 0;
  

    if (!isNaN(snicker)) {
        total += (snicker * .59);    
    }
 
    if (!isNaN(twix)) {
        total += (twix * .49);
    }
 
    if (!isNaN(chips)) {
        total += (chips * .39);
    }
 
    total += (salesTax * total);
 
    if (total != 0) {
        alert("The total is " + total);
        return false;
    } else {
        alert("Invalid total cost, please make a selection");
    }
}