How To Pre-populate Datepicker Textbox With Today's Date Using JQuery?

Jquery_logo


Suppose we have a textbox and we want to add a datepicker in it. We can do this easily with the help of JQuery.

Here is the working code:
<input type="text" size="10" value="" id="datepicker1"/>

JQuery Code:

$(function() {
$("#datepicker1").datepicker({
dateFormat: "yy-mm-dd"
}).datepicker("setDate", "0");
})


Check live example here: http://jsfiddle.net/jeetu_verma11/X4Bcf/
Share on Google Plus

About JK STACK

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.

1 comments:

  1. Find code snippets in any language CodeProZone
    https://codeprozone.com/code/cpp/36047/error-ISO-C-forbids-comparison-between-pointer-and-integer-fpermissive-ifsi-b.html
    Its a developer’s community where programmers and developers from the globe share the codes and many can learn from their experiences. Here codes are shared written by Master Coders and many follow their pattern. These codes help developers to grow and be at home in their skills. By using these codes, a developer can develop their projects faster, can easily understand and may have more chances to boom in their field.

    ReplyDelete