Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当他们单击按钮时,我正在尝试向页面添加内容。客户给了我一份清单,它可能是 3 或 300 长。我不想为每个人提供 300 个表单域。如何创建一个脚本,当他们单击一个按钮时,它会一次又一次地添加表单字段,或者他们单击它多少次。
很简单。
$("#idofbutton").click(function() { var inputElement = "<input type='text' />"; $("#idOfContainer").append(inputElement); });