Struggling to crack the code for my calculator. Despite consulting my textbook, I can't seem to figure out why it won't calculate properly. Any advice or tips would be greatly appreciated.
<html>
<head>
<title> Total Calculator </title>
</head>
<body>
<p>
Apples: <input type="text" id="applesBox" value=""> at $0.60 per piece<br>
Oranges: <input type="text" id="orangesBox" value=""> at $0.75 each<br>
Pears: <input type="text" id="pearsBox" value=""> at $1.00 each<br>
Grapes: <input type="text" id="grapesBox" value=""> at $2.50 per pound<br>
TAX is 8%
</p>
<input type="button" value="Calculate"
<button id='Calculate' onclick= "Calculate()" value="Calculate">Calculate</button>
<script type="text/javascript">
function Calculate() {
var total = 0;
var cost = document.getElementById("cost").value;
var tax = document.getElementById("tax").value;
total = cost*tax;
document.getElementById("total").value = total;
document.getElementById('outputDiv').innerHTML= 'Your TOTAL is: ' + total;">
}
</script>
<hr>
<div id="outputDiv"></div>
</body>
</html>