[英]Bootstrap datepicker clone not working
I use simple datepicker for twitter bootstrap http://bootstrap-datepicker.readthedocs.io/en/latest/ 我将简单的datepicker用于Twitter引导http://bootstrap-datepicker.readthedocs.io/en/latest/
Try to clone input tag and append into another div. 尝试克隆输入标签并追加到另一个div中。 First input tag datepicker works perfectly. 第一个输入标签datepicker可以正常工作。 But second one(cloned input tag) isn't working at all. 但是第二个(克隆的输入标签)根本不起作用。
I tried with this code 我尝试了这段代码
<div class="first">
<input type="text" class="form-control sandbox-container">
</div>
<br>
<div class="second">
</div>
$('.sandbox-container').datepicker({
});
$( ".sandbox-container" ).clone().appendTo( ".second" );
Here is the jsfiddle 这是jsfiddle
Any solution? 有什么办法吗?
add .datepicker
as well to your clone. 将.datepicker
也添加到您的克隆中。
$( ".sandbox-container" ).clone().appendTo( ".second" ).datepicker({
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.