I have the following code:
var max = new Date().getFullYear(),
min = max - 90,
select = document.getElementById('selectYear');
for (var i = min; i<=max; i++){
var opt = document.createElement('option');
opt.value = i;
opt.innerHTML = i;
select.appendChild(opt);
}
<select id="selectYear">
</select>
I use it to popule me in a select the years, from the current year to 90 years less than this.
What I would like could help me is how to achieve the same result, but instead of presenting me the years from (1927 to 2017) I present them (2017 to 1927)
Some Suggestion
Thank you very much.