У меня есть таблица, которая генерируется динамически и выглядит следующим образом:
![enter image description here](https://i.stack.imgur.com/txhnL.png)
Так создается таблица динамически
var cageref = CatalogueDB.ref("cageawards/" + cagecode).limitToFirst(20);
cageref.on('value', pullInventory, errData);
function pullInventory(data) {
var container = document.getElementById('inventoryContainer')
console.log(data.val())
data.forEach(function(awardsSnap) {
var awardItem = awardsSnap.val()
// Attach an asynchronous callback to rea
var NSNcard = `
<tr>
<td class="serial">${awardItem.NSN}</td>
<td> ${awardItem.Nomenclature} </td>
<td> <span class="serial">${awardItem.Awarddate} </td>
<td> <span class="product">${awardItem.Awardid}</span> </td>
<td>
<input type="text" placeholder="i.e. 100 EA" class="form-control" style="width: 110px;">
</td>
<td>
<input type="text" placeholder="i.e. $9.23 " class="form-control" style="width: 110px;">
</td>
</tr>
`;
container.innerHTML += NSNcard;
});
}
<div class="table-stats order-table ov-h">
<table class="table ">
<thead>
<tr>
<th class="serial">NSN</th>
<th>Nomenclature</th>
<th>Award Date</th>
<th>Award #</th>
<th>Quantity</th>
<th>Price per Unit</th>
</tr>
</thead>
<tbody id="inventoryContainer">
</tbody>
</table>
</div>
<!-- /.table-stats -->
происходит то, что пользователям показывается их инвентарь, а рядом с каждым элементом есть поле для ввода количества и цены. Что я хочу сделать сейчас, это добавить кнопку Сохранить. При нажатии кнопки я хочу получить количество, цену и другие значения для каждой доступной позиции. Я новичок в javascript и предполагаю, что это возможно. Как бы я это сделал?
Function saveInventory(){
// Get each of the line item values
}