Like this?:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>untitled</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
onload=function(){
var d=new Date();
currYear = d.getFullYear();
var sel=document.getElementById('year');
var nrMax=3, opt;
for(var i=0;i<nrMax;i++){
opt=document.createElement('option');
opt.setAttribute('value',currYear);
opt.appendChild(document.createTextNode(currYear));
sel.appendChild(opt);
currYear++;
}
}
</script>
</head>
<body>
<form action="">
<select name="year" id="year">
</select>
</form>
</body>
</html>
Bookmarks