Datepicker setDate not working anymore?

Can you explain to me why this code:

http://jsfiddle.net/3qJx9/7/

does not work?

I used it to put the current date by default when the date was not loaded, but it no longer works, and I do not understand why.

Thank!

+3
source share
1 answer

You can only call methods on jQuery UI initialized widgets, and you forgot to initialize datepicker:

$("#date").datepicker();
$("#date").datepicker("setDate", new Date());

Updated JSFiddle

+9
source

All Articles