The below code snippet explains how to display Month and Year Dropdowns in jQuery DatePicker plugin.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js" type = "text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type = "text/javascript"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel = "Stylesheet" type="text/css" />
<script type = "text/javascript">
$(document).ready(function () {
$("#txtDate").datepicker(
{
changeMonth: true,
changeYear: true
});
});
</script>
Explanation:
In the above jQuery code snippet I have implemented jQuery DatePicker with Month and Year Dropdowns to choose and change the Month and Year from the Dropdowns