I have jQuery click event which is create group of div or container for every clicking the button . All I want is to create a container every click on a button.
Here is the HTML container create on every button click.
<button type="button" id="add_container">Add Container</button
<div class="container">
<div class="label">
<span>I'm the Label</span>
</div>
<div class="margin-select">
<div class="padding-select">
<select class="select2>
<option>Choose 1</option>
<option>Choose 2</option>
</select>
</div>
</div>
</div>
jQuery:
$('#add_container').on('click', function(){
//add a container every click event <div class="container">...</div>
})
.containerelement always exists in the DOM when the page loads then you can use clone() and append()