Greetings I have an array of this type. Run the code that allows you to make the required number of Divs, that is, clones of a certain shape. They are filled from the array, in this case 3 forms come out with the assigned data from each array. In each form, I have an Input inserted that allows to add an item to the collection. The problem is that I cannot send values a1, a2, b1, b2, respectively, to data-name = "" data-price = "". Which leads to the fact that only one and the same element from any form comes to the collection when the button is pressed. Input ID changes when copying.
var Toys = [a1, a2],[b1,b2]; <input id="Button" type="button" value="Add colection" onclick="href="#" class="cart" data-name="" data-price="">
$('#button').data('name', Toys[0]).data('price', Toys[1])in a similar way - Jean-Claude