I am trying to calculate a Age of a person. I have 3 different input boxes named monthv, dayv and yearv respectively and one dynamic text box named result. I have the following code
but when I click the button after entering the date of birth it show
birth=new Date(yearv.text, monthv.text, dayv.text);
result.text = "you are " +age + " years old. ";
It does not calculate the age instread it shows undefined. IS my code correct? or am I missing something?
you are undefined years old.
Please help me