How to duplicate dynamic form using jquery click
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/7594149/how-to-duplicate-form-content-in-jquery">How to duplicate form content in jQuery?</a>  </p>
</blockquote>



<p>My question is similar to this thread:
<a href="http://stackoverflow.com/questions/7594149/how-to-duplicate-form-content-in-jquery">How to duplicate form content in jQuery?</a></p>

<p>Currently I have this html code:</p>

<pre><code>&lt;ul&gt;
&lt;li&gt;&lt;h4&gt;Item 01&lt;/h4&gt;&lt;/li&gt;

&lt;li&gt;&lt;label for="code"&gt;Product Code&lt;/label&gt;&lt;/li&gt;
&lt;li&gt;&lt;input type="text" name="product_code1" id="code" /&gt;&lt;/li&gt;

&lt;li&gt;&lt;label for="size"&gt;Size&lt;/label&gt;&lt;/li&gt;
&lt;li class="qty"&gt;&lt;input type="text" name="product_size1" id="size" /&gt;&lt;/li&gt;

&lt;li&gt;&lt;label for="qty"&gt;Quantity&lt;/label&gt;&lt;/li&gt;
&lt;li class="qty"&gt;&lt;input type="text" name="product_qty1" id="qty" /&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p class="add_item"&gt;&lt;input type="button" id="btnAdd" value="Add Item" /&gt;&lt;/p&gt;
</code></pre>

<p>If the user clicks the add button, it will create a new ul li list with the header name as Item 02 and as well as for all the other input name with product_code2, etc. So on and so forth if the user clicks the add button. But I have no idea how to write the JS code.</p>

<p>This form will then be send to email using php. I was thinking of attaching an ID to the UL but not sure is it a good way to do it or is there other better way?</p>

<p>Hope you guys can help me out. Thanks in advance.</p>
