diff --git a/projects/age-calculator/index.html b/projects/age-calculator/index.html index 7ef5c27..efa3c2f 100644 --- a/projects/age-calculator/index.html +++ b/projects/age-calculator/index.html @@ -14,6 +14,9 @@

Age Calculator

+ +

+

Your age is 21 years old

diff --git a/projects/age-calculator/index.js b/projects/age-calculator/index.js index b2888ee..40eba98 100644 --- a/projects/age-calculator/index.js +++ b/projects/age-calculator/index.js @@ -29,3 +29,11 @@ function getAge(birthdayValue) { } btnEl.addEventListener("click", calculateAge); + +// ✅ New: Clear button logic +const clearBtn = document.getElementById("clearBtn"); + +clearBtn.addEventListener("click", function () { + birthdayEl.value = ""; + resultEl.innerText = ""; +});