Question : How to auto populate dropdown with last 10 calendar years?

I would like to auto populate a dropdown menu with the last 10 calendar years. The attached version works only when I'm connected to the internet. Would anyone please help me customize it so that it auto populates offline as well?
Thank you.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){

    // Prepare year field 10 years ago up to current year
	var years = '<option selected="selected"></option>';
	var thisYear = new Date();
	thisYear = thisYear.getYear();
	if (thisYear < 1900) thisYear += 1900;
	thisYear = parseInt(thisYear);
	for(i=0; i<=10; i++) {
		currYear = thisYear - i;
		years += '<option value="'+currYear+'">'+currYear+'</option>';
	}
	$('select[name=MyReport_Year]').html(years);
});
//]]>
</script>
</head>

<body>
<select name="MyReport_Year"></select>
</body>
</html>

Answer : How to auto populate dropdown with last 10 calendar years?

Save the following file jquery.min.js on your drive at the same level (for example) of your page : http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js
and replace line 6 by : < script type="text/javascript" src="jquery.min.js" >< /script >
Random Solutions  
 
programming4us programming4us