I am trying to figure out what's wrong with my script. When the input reaches 1, it should display the alert but it does't. But if i replace (value === 1) with (value === value), it displays the alert every time i change the input. So i know the problem is with the syntax "(value === 1)". I tried everything. 5 hours weren't enough for me to find a solution on the internet, so i hope someone tells me if i made mistake with the syntax or something. Thank you for your time.
<input id="carrotate123" type="range" min="0" max="3" value="2" oninput="getInput(this.value)">
<script>
function getInput(value) {
var rangeInput = document.getElementById("carrotate123").value;
var value = rangeInput.value;
if (value === 1) {
alert("First");
}
}
</script>