JQuery的Datepicker

DatePicker.html

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Default functionality</title>
<script src="jquery/jquery-1.8.3.js"></script>
<script src="jquery-ui/js/jquery-ui-1.9.2.js"></script>
<script src="jquery-ui/js/jquery.ui.datepicker-zh-CN.js" type="text/javascript" charset="gb2312"></script>
<link rel="stylesheet" href="jquery-ui/css/custom-theme/jquery-ui-1.9.2.css"></link>
<script>
	$(function() {
	    $( "#datepicker" ).datepicker();
	});
	/*
	$(function() {
		$("#datepicker").datepicker( {
			changeMonth : true,
			changeYear : true
		});
	});
	*/
</script>
</head>
<body>

<p>Date: <input type="text" id="datepicker"></p>

</body>
</html>

运行结果:

JQuery的Datepicker

        如果要设置下拉的年、月,设置changeMonth、changeYear为true即可,如上注释的代码。

相关推荐