开发者

Datepicker setDate doesn't work anymore?

开发者 https://www.devze.com 2023-03-05 23:36 出处:网络
can you explain me why this code : http://jsfiddle.net/3qJx9开发者_如何转开发/7/ doesn\'t work ?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号