So I have this code, it shows the total in orange whenever the totalBillCost exceeds warningLevel and shows it in red whenever the totalBillCost exceeds criticalLevel.
But I also want it to prevent costs from being added whenever the totalBillCost is greater or equal to critalLevel. Please help me with that.
PS: let me know if I should post my other functions for understanding.
function totalColor(totalBillCost){
total.classList.remove("danger");
total.classList.remove("warning");
if(totalBillCost >= warningLevel && totalBillCost < criticalLevel){
total.classList.add("warning");
}else if(totalBillCost >= criticalLevel){
total.classList.add("danger");
}
}
Aucun commentaire:
Enregistrer un commentaire