var controls = `<div class='tableTicketLine tableBody'>
<div class='tableTicketFlex'><input class='inpt'></div>
<div class='tableTicketFlex'><input class='inpt unlimit' placeholder='∞'></div>
<div class='tableTicketFlex'><input class='inpt'></div>
<div class='tableTicketFlex'><input class='inpt'></div>
<div class='tableTicketFlex'><button class='delButton'><i class='fas fa-trash'></i></button></div>
</div>`
$('.addButton').click(function() {
$('.tableTicket').append($(controls));
});
let counter = 0;
$('.tableTicket').each((index, elem) => {
$(elem).append($(controls));
return counter++ < 10; // break loop when counter is 10
});
$('.tableTicket:nth-child(-n+10)').append($(controls));