var a = '10,1,4,14,15,100,400,150'; var b = 1; var mas=a.split(",") for(var i=0;i<mas.length;i++) if(b==mas[i]) alert(mas[i]);