What is the Simple way of age calc in JavaScript

Asked By 370 points N/A Posted on -
qa-featured

 

Dear Experts,

I am working on a project in which user inputs date of birth and I want to know the simplest way of age call in JavaScript. So the output will be "you are ____ Years Old."

Thanks

 

SHARE
Answered By 0 points N/A #196310

What is the Simple way of age calc in JavaScript

qa-featured

 

Hello Martin Harris,

Here in the attachment below is a JavaScript for calculating ages, from the date of birth in applications. You can download the .txt file. The date of birth is in YY-MM-DD (year-month-day) format. You should make an application in this format and when you enter the date of birth results will show how old are you.

Also this JavaScript lets if someone logs with the date of birth like someone else to allow register. If a user is less than 18 years will not be able to log. Function chkAge () calculates the ages based on the date of birth, function show Message () give the output Invalid Message if date of birth isn't in appropriate format YY-MM-DD and a function days In Month (month, year) gives how many days have every month in years.

I hope this code will help you!

Regards,

Williamson Mellisa

 

Login/Register to Answer

Related Questions