Skip to content

Commit e0ede91

Browse files
committed
Add even more comments
1 parent 3905632 commit e0ede91

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
const amountInput = document.getElementById("amount"); //amount input
22
const tipPercentInput = document.getElementById("tip-percent"); //tip percent input
33
const calculateButton = document.getElementById("calculate"); //calculate button
4-
const outputText = document.getElementById("output"); //output text
4+
const outputText = document.getElementById("output"); //output text area
55
calculateButton.addEventListener("click", () => {
66
//when calculate button is pressed
77
let amount = parseFloat(amountInput.value); //get amount value
88
let tipPercent = parseFloat(tipPercentInput.value); //get tip percent value
99
let totalAmount = amount * (1 + tipPercent / 100); //get total billing amount
10-
outputText.innerText = `Total Amount: ${totalAmount.toFixed(2)}`; //format total billing amount
10+
outputText.innerText = `Total Amount: ${totalAmount.toFixed(2)}`; //set output text area to format total billing amount
1111
});

0 commit comments

Comments
 (0)