its my first time, so please be gentle. I wrote a simple number comparison a while ago. But the comparison gives back a "wrong" bool.
Heres my Code:
var UpperLimit = document.getElementById("UpperLimit").value;
var LowerLimit = document.getElementById("LowerLimit").value;
if (UpperLimit < LowerLimit){
alert("Upper Limit is smaller as the Lower Limit!")
return false; //Exit Function
} else {
// **do something with the Upper and Lower Limit**
}
Lower Limit:<input style=" margin-left: 15px;" class="Limit" id="LowerLimit" type="number">m³</input>
Upper Limit:<input style=" margin-left: 17px;" class="Limit" id="UpperLimit" type="number">m³</input>
If i (for example) enter 150 for Lower Limit and 1000 for the Upper Limit in HTML, the comparison give me back a "true" and shows the alert. I dont know where the error is, i guess JS is interpreting the value wrong but i dont know what to do.
Thanks for your help!
Caliban