Mon - Sun 8.00 AM - 8.00 PM
[email protected]
Home
Articles
Our Courses
HTML 5
CSS
JavaScript
MySql
PHP
Laravel
Bootstrap
Our Tutorials
PHP
JavaScript
HTML
Laravel
MySQL
JQuery
CSS
Git
Bootstrap
Vue JS
Android
Ui Code Snippets
Chat Box
Range Slider
Radio Button
Select Box
Nav Bar
Other
Testimonial
Carousel
Logo
Loader
Lightbox
Login Form
Modals
OTP Verification Form
Popular Notes
HTML
CSS
JavaScript
SQL
Services
About
Contact Us
Ui Code
Snippets
jQuery Datepicker Using jQuery Ui With Date Format
HTML
CSS
JS
Output
HTML
<html lang="en"> <head> <title>jQuery Datepicker Using jQuery Ui With Date Format</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.js"></script> <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.0.0-alpha/css/bootstrap.css" rel="stylesheet"> <link href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.css" rel="stylesheet"> </head> <body> <div class="mainDiv"> <div class="container"> <h1 class="text-center">jQuery Datepicker Using jQuery Ui With Date Format</h1> <div class="inputsMainDiv"> <label>Date of Birth</label> <input type="text" id="myDatepicker1" class="from-control"><br> <label>Current Date</label> <input type="text" id="myDatepicker2" class="from-control"> </div> </div> </div> <script> for(var i= 1; i<=2;i++){ $("#myDatepicker"+i).datepicker({ dateFormat: 'dd-MM-yy' }); } </script> </body> </html>
CSS
.mainDiv{ display: flex; justify-content: center; align-items: center; height: 100vh; } .mainDiv .container h1{ font-size: 24px; color: rgb(2, 0, 90); } .mainDiv .container label{ color: rgb(47, 0, 90); } .mainDiv .container input{ border: 1px solid #ddd; border-radius: 10px; padding: 0.6rem 1rem; color: #bbb; } .inputsMainDiv{ display: flex; justify-content: center; flex-direction: column; }
JS
for(var i= 1; i<=2;i++){ $("#myDatepicker"+i).datepicker({ dateFormat: 'dd-MM-yy' }); }
Output