jQueryの日付ピッカーを使用していて、入力要素を複製したいとします。 jQueryコードは、日付ピッカーではなく、静的な要素を複製するときにうまく機能しているようです。クローンjQuery入力の日付ピッカー要素
$(function(){
var $button = $('.datepicker-input--checkin').clone();
$('.package').html($button);
});
$(function(){
$('#thedate').datepicker({
dateFormat: 'dd-mm-yy',
altField: '#thealtdate',
altFormat: 'yy-mm-dd'
});
});
示した電界:
<input id="thedate" type="text" class="datepicker-input--checkin" /><br />
非表示フィールド:
<input id="thealtdate" type="text" class="datepicker-input--checkin" /><br />
<input id="thesubmit" type="button" value="Submit" />
<div class="package">
</div>
をあなたはhttps://jsfiddle.net/txqepe36/8/ – Kanu