Datepicker setDate doesn't work anymore?
can you explain me why this code :
http://jsfiddle.net/3qJx9开发者_如何转开发/7/
doesn't work ?
I used to use it in order to put the current date as default when no date were loaded, but it doesn't work anymore, and I don't understand why.
Thanks !
You can only call methods on an initialized jQuery UI widget and you forgot to initialize the datepicker:
$("#date").datepicker();
$("#date").datepicker("setDate", new Date());
Updated JSFiddle
精彩评论