How do I code script that compares a a range slider value with 49. If more than 49 if shows true, if less than 50 displays false.
<input type="range" min="0" max="100" id="var1" step="1">
How do I code script that compares a a range slider value with 49. If more than 49 if shows true, if less than 50 displays false.
<input type="range" min="0" max="100" id="var1" step="1">
Assuming you want something to change while when the user changes the slider, try this
window.onload=function() {
document.getElementById("number").onchange=function() {
document.getElementById("rngnum").innerHTML=this.value<49?"False":"True";
}
document.getElementById("number").onchange(); // trigger when loaded
}
<input type="range" min="0" max="100" id="number" step="1" value="50"><label for="number" id="rngnum"></label>
If you just need to interrogate it:
var lessthan49=parseInt(document.getElementById("number").value)>49?true:false;