I have tried everything I can find on here and all over the Internet and this just will not work.
I simply want to check the input type="number" to see if it matches a number already in the database. For now I have kept it simple as I can work out the rest.
Here is my code:
The Input:
<input style="width: 50px; font-size: 17px;" type="number" min="1" autocomplete="off" id="days" name="days" value="1" onchange="daysChange(this.days)" required />
Here is the Javascript:
function daysChange(days) {
var day = document.getElementById("days");
if (day == "3"){
alert("You Already Have An Email Going Out That Day. Please Select Another Day.");
}
}
It's not picking up the value of days. Instead if I do an alert and have it output the value this is what it says... [object HTMLInputElement]
day.value.if (day.value == "3"){}.