Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dob = new Date($("#DateOfBirth").val())
- var today = new Date();
- var age = Math.floor((today - dob) / (365.25 * 24 * 60 * 60 * 1000));
- $('#txtAge').val(age + ' years old');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement