The code below inserts a new select
when clicking the button, but this new list should only consist of the remaining items, ie the new select
can not have the option
selected no select
previous.
$(document).ready(function(e) {
$('#addComp').on('click', function(){
$('.itemComposicao').append($('.itemComposicao').children(":first").html());
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divclass="itemComposicao">
<div class="form-group">
<select class="composicao">
<option value="1">Alumínio</option>
<option value="2">Cobre</option>
<option value="3">PVC</option>
</select>
</div>
</div>
<button type="button" id="addComp">Inserir</button>
Update :
Note: after duplicating this item, how do you make sure that% "inserted"% does not appear in the previous%%?