Wrapping around the code into jQuery plugin to select years between start and end year:
jQuery.extend(jQuery.fn,{
/*
** Year selection plugin
** Sample usage
** $('#yearpicker').years(2007, 2017);
**
** HTML
**
*/
years: function(start, end) {
for (i = start; i <= end; i++)
{
$(this).append($('').val(i).html(i));
}
}
});