From c993c7b728e3714e8d091bd9cada3828feb11514 Mon Sep 17 00:00:00 2001 From: Andy Hubert Date: Thu, 18 Jul 2024 16:45:31 +0000 Subject: [PATCH] added event listener --- yoseph/main.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/yoseph/main.js b/yoseph/main.js index 27fd30d..2051800 100644 --- a/yoseph/main.js +++ b/yoseph/main.js @@ -33,5 +33,21 @@ let StupidSubtract = document.querySelector(`#stupid-expense-amount`).value let PayAmount = document.querySelector(`#pay-amount`).value document.querySelector(`#savings-expense-enter`).addEventListener(`click`, () => { - alert('oooooooooooooh yeaaaaaaaaaaa') + SavingsSubtract = document.querySelector(`#savings-expense-amount`).value + Savings = Savings - SavingsSubtract + document.querySelector(`#savings-total`).innerHTML = Savings +}) + +document.querySelector(`#pay-enter`).addEventListener(`click`, () => { + PayAmount = document.querySelector(`#pay-amount`).value + PayAmount = Number(PayAmount) + Savings = Savings + PayAmount + document.querySelector(`#savings-total`).innerHTML = Savings + document.querySelector(`#pay-amount`).value = '' +}) + +document.querySelector(`#stupid-expense-enter`).addEventListener(`click`, () => { +}) + +document.querySelector(`#title-clear`).addEventListener(`click`, () => { }) \ No newline at end of file