The function "calcFinalTotal()" was created to calculate the post-tax discount on a purchase of items that were previously totaled and stored in an input tag with the ID of "totaltaxamount".
This function applies a 10% discount to orders between $50 to $100, a 20% discount to orders between $101 and $150, and a 25% discount to orders over $250 (calculated using if-else statements).
The discounted total calculated by calcFinalTotal() is then placed into an input tag with the ID of "totalFinal".
However, there's an issue... when the value in "totaltaxamount" is less than $50, nothing is displayed in "totalFinal".
function calcTotal() {
// Code for calculating total goes here
}
function calcFinalTotal() {
// Code for calculating final total after applying discounts based on the total amount goes here
}
// HTML and CSS code present below ...
<html>
<head>
<link rel="icon" type="image" href="bee.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bea's Bakery</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="functions.js"></script>
</head>
<body>
<!-- Page layout structure and order form elements -->
</body>
</html>
We need your assistance!