const addRowBtn = document.getElementById('add-row');
const receiversTable = document.querySelector('#receivers-table tbody');

addRowBtn.addEventListener('click', () => {
    var row      = receiversTable.insertRow(-1);
    var cell     = row.insertCell(0);
    var cell1    = row.insertCell(1);
    var cell2    = row.insertCell(2);
    var cell3    = row.insertCell(3);
    cell.innerHTML = '<input type="number" class="form-control" name="shipping-prices-min[]" value="">';
    cell1.innerHTML = '<input type="number" class="form-control" name="shipping-prices-max[]" value="">';
    cell2.innerHTML = '<input type="number" class="form-control" name="shipping-prices-price[]" value="">';
    cell3.innerHTML = '<button type="button" class="btn btn-danger btn-sm" onclick="deleteRow(this)"><i class="bi bi-trash"></i></button>';
});

function deleteRow(btn) {
    var row = btn.parentNode.parentNode;
    row.parentNode.removeChild(row);
}