O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding Datepicker Element

$( "#month" ).datepicker({     onSelect:dateChanged,     showOn: "button",     buttonImage: "calendar.png",     buttonImageOnly: true,     numberOfMonths:2,     showButtonPanel:true,     dateFormat: "yy-mm-dd"   });

The datepicker widget provided with jQuery allows you to implement a calendar interface so users can select a specific day using a simple click of the mouse. This can prevent a lot of problems when users input dates incorrectly because they are typing them by hand.

The datepicker widget is attached to a text, date, or datetime <input> element by calling the .datepicker() method. When the user clicks on the <input>, the calendar is displayed. You can also add an icon image ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required