jQuery datepicker - defaultDate (dynamically) from another datepicker
问题 I have two datepickers at the moment, one for a start date, and another for an end date. When you select the first date, I'd like the default value of the second datepicker to be set to the same date. If I use the setDate it works and sets the value just fine, but the default value won't change - if I set the defaultDate when the datepicker is loaded, it works, but if I try to set it on the fly it doesn't. Here's my code: if($('#startDate').val().length == 10 && $("#endDate").val().length !=