We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5698abe commit 704130bCopy full SHA for 704130b
2 files changed
Projects/bill tip calculator/app.js
@@ -101,6 +101,17 @@ function init() {
101
102
}
103
104
+
105
+// reset current state
106
+resetBtn.onclick = () => {
107
+ numOfPeople = 1;
108
+ tipPercentage = 0;
109
+ billAmt = 0;
110
+ billTotal.innerHTML = `$ 0.00`
111
+ tipTotalPerPerson.innerHTML = `$ 0.00`
112
+ billTipPerPerson.innerHTML = `$ 0.00`
113
+}
114
115
function calculateTip(billAmt, numberOfPeople, tipPercentage) {
116
const tipAmt = (billAmt * (tipPercentage / 100))
117
const tipAmtPerPeron = (tipAmt / numberOfPeople)
Projects/bill tip calculator/main.js
0 commit comments