Here is the code snippet I am referring to:
function myFunction() {
var x = document.getElementById("ins-feet").value;
if(x >= 0 && x <= 1499) {
document.getElementById("show-cost").innerHTML = "Cost: $" + 300;
} else if(x >= 1500 && x <= 1999) {
document.getElementById("show-cost").innerHTML = "Cost: $" + 320;
} else if(x >= 2000 && x <= 2500) {
document.getElementById("show-cost").innerHTML = "Cost: $" + 340;
} else if(x > 2500) {
var additionalCost = (x - 2500) * 0.10;
document.getElementById("show-cost").innerHTML = "Cost: $" + (340 + additionalCost);
}
}
I need help with the last line. When x is greater than 2500, the "show-cost" will display 340 plus an additional 0.10 for every increment. For example, if x > 2501, the cost would be 340.1, and for x > 2502, the cost would be 340.2, and so on.