Firstly the HTML file
<form name=requirements action = "test2.js" method="GET">
<table border="3px">
<tr>
<td></td>
<td><b>Price List</b></td>
<td></td>
</tr>
<tr>
<td>Items</td>
<td>Quantity</td>
<td>Price</td>
<td>Requirement</td>
</tr>
<tr>
<td>1 Bottle</td>
<td>1 item</td>
<td>4.10 Euros</td>
<td><input type="number" name="bottle" maxlength="20"></td>
</tr>
<tr>
<td>1 Pack</td>
<td>11 bottles</td>
<td>40 Euros</td>
<td><input type="number" name="pack" maxlength="20"></td>
</tr>
<tr>
<td>1 Box</td>
<td>24 packs</td>
<td>950 Euros</td>
<td><input type="number" name="box" maxlength="20"></td>
</tr>
<tr>
<td>1 chocolate bar</td>
<td>1 bar</td>
<td>3 Euros</td>
<td><input type="number" name="bar" maxlength="20"></td>
</tr>
<tr>
<td>1 chocolate pack</td>
<td>5 bars</td>
<td>14 Euros</td>
<td><input type="number" name="back" maxlength="20"></td>
</tr>
<tr>
<td><input type="submit" value="submit"></td>
</tr>
</table>
</form>
below is the .js file named test2.js
let bottle = document.getElementById("bottle").value;
let pack = document.getElementById("pack").value;
let packf = pack * 11;
let box = document.getElementById("box").value;
let boxf = box * 264;
let total = boxf + packf + bottle;
let required = total;
console.log(required);
how do I send the form data from the HTML file to test2.js
and return the result and print it in the HTML page?