How to create datepicker using jquery ui
Whenever click or focus on the textbox (input box) then we will be open the dialog box, after then we can easily select a date. if you want to close datepicker dialog box then click anywhere on the page, after then datepicker dialog box will be closed. The page will be attractive to put or paste a datepicker inside the form. In this following example in First load the jquery Ui CSS and second load the jquery min js and after then load the jquery Ui js.
I think this tutorial will be helpful.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | <html> <head> <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="/resources/demos/style.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> <script> $( function() { $( "#datepicker" ).datepicker(); } ); </script> </head> <body> <div>Date: <input type="text" id="datepicker"></div> </body> </html> |
Please follow and like us: