I am attempting to create a basic if statement that alters the background color of a div based on a number input in another div. Despite my efforts to modify the code, I can't seem to get the final else if statement to function properly.
if ($(".pacenumber").text() <= "59") {
document.getElementById("paceheader").style.backgroundColor = "red";
}
else
if ($(".pacenumber").text() >= "60" < "80") {
document.getElementById("paceheader").style.backgroundColor = "yellow";
}
else
if ($(".pacenumber").text() >= "80") {
document.getElementById("paceheader").style.backgroundColor = "green";
}
When the entered number is less than or equal to "59", the div correctly turns red.
For numbers greater than or equal to "60" and less than "80", the div changes to yellow as expected.
Unfortunately, when the entered number is 80 or higher, the div remains yellow instead of turning green.
I am seeking a potential solution to address the issue with the last if statement.