I'm trying to fire a function if an input field's value is equal to that of a number in an array.
I have my code below, but it doesn't seem to work!!
var num1 = $("#people-number").val();
var Numberarray = [1,3,5,7,9];
if ($.inArray(num1,Numberarray) > -1) {
$("#valid-people").hide();
$("#non-valid-people").fadeIn();
}
Any tips would be appreciated.....