I have a table with some date in it:
<tr class="unit-table'">
<td><input type="text" name="" id="item"></td>
<td><input type="text" name="" id="price"></td>
<td><input type="text" name="" id="qty"></td>
<td><input type="text" name="" id="disc"></td>
</tr>
User can add new rows to this table. I'm using Fetch API to post this data. The response from API am trying to post is looks like this
"computer_and_infrastructure": [
{
"item": "Computer Support",
"unit_price": 30,
"qty": 5,
"discount": 0
}
]
My question is how can I loop through all table data and add it to my request?