Your Attractive Heading
<form>
<table>
<tr>
<th>Quantity</th>
<th>Product</th>
<th>Description</th>
<th>Add</th>
<th>Total</th>
</tr>
<tr>
<td><input type="number" id="quantity" name="quantity"></td>
<td>
<select id="product" name="product">
<option value="Product 1">Product 1</option>
<option value="Product 2">Product 2</option>
<option value="Product 3">Product 3</option>
</select>
</td>
<td><textarea id="description" name="description"></textarea></td>
<td><button type="button" onclick="addProduct()">Add</button></td>
<td><input type="number" id="total" name="total" readonly></td>
</tr>
</table>
<div id="product-list"></div>
</form>
<script>
let productList = [];
let total = 0;
function addProduct() {
let quantity = document.getElementById('quantity').value;
let product = document.getElementById('product').value;
let description = document.getElementById('description').value;
let price = 10; // default price
let productTotal = quantity * price;
total += productTotal;
productList.push({
quantity: quantity,
product: product,
description: description,
total: productTotal
});
document.getElementById('total').value = total;
updateProductList();
}
function updateProductList() {
let productListHtml = '';
for (let i = 0; i < productList.length; i++) {
productListHtml += `
<p>Quantity: ${productList[i].quantity}</p>
<p>Product: ${productList[i].product}</p>
<p>Description: ${productList[i].description}</p>
<p>Total: ${productList[i].total}</p>
<hr>
`;
}
document.getElementById('product-list').innerHTML = productListHtml;
}
</script>
<form>
<table>
<tr>
<th>Quantity</th>
<th>Product</th>
<th>Description</th>
<th>Add</th>
<th>Total</th>
</tr>
<tr>
<td><input type="number" id="quantity" name="quantity"></td>
<td>
<select id="product" name="product">
<option value="Product 1">Product 1</option>
<option value="Product 2">Product 2</option>
<option value="Product 3">Product 3</option>
</select>
</td>
<td><textarea id="description" name="description"></textarea></td>
<td><button type="button" onclick="addProduct()">Add</button></td>
<td><input type="number" id="total" name="total" readonly></td>
</tr>
</table>
<div id="product-list"></div>
</form>
<script>
let productList = [];
let total = 0;
function addProduct() {
let quantity = document.getElementById('quantity').value;
let product = document.getElementById('product').value;
let description = document.getElementById('description').value;
let price = 10; // default price
let productTotal = quantity * price;
total += productTotal;
productList.push({
quantity: quantity,
product: product,
description: description,
total: productTotal
});
document.getElementById('total').value = total;
updateProductList();
}
function updateProductList() {
let productListHtml = '';
for (let i = 0; i < productList.length; i++) {
productListHtml += `
<p>Quantity: ${productList[i].quantity}</p>
<p>Product: ${productList[i].product}</p>
<p>Description: ${productList[i].description}</p>
<p>Total: ${productList[i].total}</p>
<hr>
`;
}
document.getElementById('product-list').innerHTML = productListHtml;
}
</script>