Format Date with Date Picker using Jquery
Submitted by jaredgwapo on Tuesday, December 22, 2015 - 11:56.
In this tutorial, we are going to learn format date with the in the given option using jquery. This is a simple project that you can use in your website or system.
Directions :
For HTML code
For JQuery code:
- <script>
- $(function() {
- $( "#datepicker" ).datepicker();
- $( "#format" ).change(function() {
- $( "#datepicker" ).datepicker( "option", "dateFormat", $( this ).val() );
- });
- });
For CSS code:
- <style>
- *
- {
- padding: 0;
- margin: 0;
- }
- body {
- font-family: "sans-serif";
- font-size: 16px;
- background-color: #eee;
- }
- #container
- {
- width: 600px;
- height: 200px;
- margin-left: auto;
- margin-right: auto;
- background-color: #fff;
- border-radius: 3px;
- }
- .head
- {
- margin-top: 100px;
- width: inherit;
- background-color: #428bca;
- text-align: center;
- font-size: 20px;
- padding: 5px 0px;
- border-radius: 3px;
- }
- .font
- {
- font-size: 16px;
- }
- table
- {
- margin-top: 30px;
- margin-left: auto;
- margin-right: auto;
- }
- </style>
For the links (Include this in your head tag)
So what can you say about this simple project? Share your thoughts in the comment section below or email me at [email protected]. Practice Coding. Thank you.
Add new comment
- 87 views