var small= +prompt('small'); var big= +prompt('big'); function f(){ while (small<big) { if ( small%2 == 0) alert(small); small++; } } f()