> for(count=1;count==howmany;count++) My guess is that everything else you have is correct. It's this particular line. Change it to: for( var count = 0; count < howmany; count++) I believe the part of you selecting the options is correct, although I haven't tested it.