jQuery UI: Date Picker
Date Picker
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/mint-choc/jquery-ui.css">
<div class="demo">
<p>Date: <input id="datepicker" type="text"></p>
</div><!-- End demo -->
<div style="display: none;" class="demo-description">
<p>The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay. Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close. If a date is chosen, feedback is shown as the input's value.</p>
</div><!-- End demo-description -->
<input type="button" id="btn" value="Click me">
CSS
/*
Add custom styling or use existing jQuery UI themes
REFERENCE: jQuery UI themes, http://blog.jqueryui.com/
*/
JavaScript
$( "#datepicker" ).datepicker();
function myDate()
{
alert($("#datepicker").datepicker("getDate"));
var dt = $("#datepicker").datepicker("getDate");
}
$(document).ready(function () {
$("#btn").click(
function () {
myDate();
}
);
});