function addYear flag var form document getElementsByTagName form var

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
function addYear(flag){
var form = document.getElementsByTagName('form');
var select = document.getElementById('year');
var option;
var first = parseInt(select.firstElementChild.value);
var last = parseInt(select.lastElementChild.value);
if(flag == 0){
first--;
var option = new Option(first,first, false, true);
select.add(option, parseInt(select.firstElementChild.index));
} else {
last++;
var option = new Option(last,last, false, true);
select.add(option, null);
}
}