When submitting a form, we need to repeat several forms and add multiple product information of different models to the order form. At this time, there is a copy form button, that is, adding a new item. You can click the copy button to add a new item. How can this problem be achieved? We will share with you the following small series. If you need a friend, you can refer to the following: when submitting a form, you may sometimes need to add multiple identical form elements, for example, you need to add fields to multiple products of different models and form data in order information. In this case, you can directly place a "add item" or "copy" button in the form, and click the button to copy the form element.
View demo download source code
HTML
This article introduces a simple jQuery-Based Element replication plug-in through examples. by calling this plug-in, you can easily implement the element replication function.
First, load the jQuery library file and the element replication plug-in duplicateElement. min. js.