函数不会附加到新创建的输入框中。 请检查我的代码此链接动态DOM创建问题
[请检查验证码] [1]
$("#datepicker").datepicker();
$("button").click(function(){
$(".add").html('<input id="datepicker" placeholder="click here to open calendar " type="text" />');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class='add'><input id="datepicker" placeholder="click here to open calendar " type="text" /></div>
<button>Add input again </button>
depen.io/anon/pen/adLzi
请包括相关的([MCVE(http://stackoverflow.com/help/mcve))代码在这里,在你的问题。不要期望人们通过互联网上的链接来获得帮助。 – 2014-09-30 10:06:31