How to add a new row to a list of inputs

Hello,

Lets say you have “row” with 2 input fields and a button next to the 2. How can I make it so that when I click on the button a new row appears underneath and so on. And then each can also be removed with a remove button.

Then finally on a random button click I get all those as some type of array or object which I can used.

Is this possible with wix?

Add a repeater
Design it to have one item per row,
Put the input elements in the repeater item.
Put a remove button (or a trash bin icon) inside the repeater item.
Put an Add button outside the repeater,

write codelike this:

let repeaterItems = [{_id: Date.now().toString()}];
$w.onReady(() => {
    $w('#repeater1').data = repeaterItems;
    $w('#addButton').onClick(() => {
        repeaterItems.push({_id: Date.now().toString()});
        $w('#repeater1').data = repeaterItems;
    })
    $w('#removeButton').onClick(event => {
        repeaterItems  = repeaterItems .filter(e => e._id !== event.context.itemId);
        $w('#repeater1').data = repeaterItems;
    })
})