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