Posted By

JonnyCraze on 03/15/12


Tagged

dropdown loop AGE selectbox intiger


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

danfolt


Javascript Select Box - Age Loop


 / Published in: JavaScript
 

I hate manually entering in tons of numbers and tags for numbers, so I made a loop for it.

  1. var i = $('#age').size();
  2. var age = 18;
  3.  
  4. for (i = 0; i < 82; i++) {
  5. $('#age').append('<option>' + age + '</option>');
  6. age++
  7. }

Report this snippet  

You need to login to post a comment.