I want to create a form with dynamic check box, when a user click the button the form will add the same form next after the previous form. I have tried a lot but didn't get it, also i tried with clone method, i get the form every time when I click the button but it was not clickable. Can anyone help?
Here is my JS below
$('#check-type').click(function(){
$('.multiple-choice').show();
var sth = $('.multiple-choice:first').clone().appendTo('.container');
$('.multiple-choice:last').hide();
});
and my HTML
<button id="check-type" value="Multiple choice">Multiple choice</button>
<div class="container"></div>
<form class="multiple-choice">
<div id="choice" class="css-selectbox">
<h3 id="title" name="question-title" class="first-header">Choice</h3>
<p class="label-checkboxitem">Which features did you like?</p>
<input id="check1" onclick=uncheck(this) type="checkbox" name="check" value="check1" class="input-checkboxitem">
<label for="check1">Materials</label>
<br> <br>
<input id="check2" onclick=uncheck(this) type="checkbox" name="check" value="check2" class="input-checkboxitem">
<label for="check2">Exam Method</label>
<br><br>
<input id="check6" onclick=uncheck(this) type="checkbox" name="check" value="check6" class="input-checkboxitem">
<label for="check6">None</label>
</div>
</form>