How do I start jQuery $.each() index from 1 instead of 0?
I am using .each function to populate select box. So here I want to populate options in the se
Seeing the clarification points in the comments below, jQuery.each or some variation thereof isn't the right tool at all. Use a for loop, and add 1 to the index to output the value of the .
Use .prepend to insert an option as the first child of a select:
for (var i = 0; i < 10; i++) {
$('select').prepend('');
}