본문으로 바로가기

<script language='javascript'>
function test(){
    var opt = document.getElementById("year").options, len = opt.length, i;
    for(i=len; i>=0; i--) opt[i] = null;
    
    for(i=4; i<=6; i++) opt[(i-4)] = new Option(i,i);
}
</script>

<SELECT name="year" id='year'>
<OPTION value=1>1</OPTION>
<OPTION value=2>2</OPTION>
<OPTION value=3>3</OPTION>
</SELECT>
<input type=button name=change value=change onClick=test()>