In this tutorial, we will learn Jquery UI Datepicker - Display Month & Year Menus Example
Example :
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>JQuery UI Datepicker - Display Month & Year Menus</title>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<style type="text/css">
.datepicker-main{
width:30%;
border-radius:15px;
margin:40px auto;
padding:40px 10px;
text-align: center;
border:1px solid #000;
}
input{
padding:5px;
}
h2{
text-align: center;
}
</style>
</head>
<body>
<h2>Jquery UI Datepicker Display Month & Year Menus Example - rathorji.in</h2>
<div class="datepicker-main">
<p>Date:
<input type="text" class="datepicker">
</p>
</div>
<script>
$( function() {
$(".datepicker").datepicker({
changeMonth: true,
changeYear: true
});
});
</script>
</body>
</html>
May this example help you.