This project is an age calculator created with HTML, CSS, and JavaScript. It allows users to calculate their age based on their date of birth.
- The calculateAge() function retrieves the user's date of birth from an HTML element with the ID 'birthdate'.
- It checks if a date of birth has been selected. If not, it displays an alert and stops execution.
- Then, it retrieves the current date.
- The date of birth is converted into a Date object.
- The age is calculated by subtracting the birth year from the current year, then the months and days are also calculated.
- There is a check for leap years, adjusting the age if the birth date falls after the current date in the same year.
- Finally, the result is displayed in an HTML element with the ID 'result'.
- Select your date of birth in the dedicated field.
- Press the "calculate Age" button to get your age.
- The result is displayed in years, months, and days.
- Developed by Mouhamed Fall
- Email : mouhamedfall056@gmail.com
- Github : @fallcoder