function in_array(what, where) { for(var i=0; i<where.length; i++) if(what == where[i]) return true; return false; } var zip = [1,2,3,4,5,6,7,8,50,48,77]; var value = 50; if (in_array(value, zip)) alert('ok'); else alert('no');