show : Show jquery UI datepicker. Example usage: $( “.selector” ).datepicker( “show” );
For complete details about all available options, methods, and functions, visit official JQuery UI date picker documentation.
An example usage of JQuery UI datepicker on a HTML page
<!doctype html>
<html lang="en">
<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>
</head>
<p>Date: < input type="text" id="datepicker"></p>
<h4 id="selectedDtaeVal"></h4>
<script>
$(function() {
$.datepicker.setDefaults({
onClose:function(date, inst){
$("#selectedDtaeVal").html(date);
$( "#datepicker" ).datepicker();
</script>
</body>
</html>
Screenshots of the above JQuery UI date picker code are shown below.
In this article, we learned how to create a date picker component using the JQuery UI date picker library.
Related