jQuery 克隆明文字段
I am trying to get the friend fields (name + email) to repeat when you click "add another friend".
Every time I try to clone the fields it includes the text inside the fields which I dont want!
Has anybody got any ideas?
Thanks in advance :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将点击事件处理程序绑定到“添加另一个朋友”
元素。在该事件处理程序中,您希望将另一行表单元素附加到
元素。
HTML:
您的 jQuery:
jsFiddle
Bind a click event handler to the "add another friend"
<div>
element. In that event handler, you want to append another row of form elements to the<p>
element.HTML:
Your jQuery:
jsFiddle
从字段中获取值后尝试设置字段
value=''
Try setting the fields
value=''
after you take the values from them