// Set the invoice total price element text to the total amount invoiceTotalPrice.innerText = "$" + totalAmount.toFixed(2); // Append the invoice total price element to the invoice total element invoiceTotal.appendChild(invoiceTotalPrice); // Append the invoice total element to the invoice list element invoiceList.appendChild(invoiceTotal); // Append the invoice section element to the body document.body.appendChild(invoiceSection); } else { // Alert the user that the cart is empty alert("Your cart is empty!"); } }