I want to auto-filled my age after selecting the date of birth, I'm using getFullYear. Is it possible to include the getMonth and getDate in selecting the date of birth? Here's my code. Javascript
<script type = "text/javascript">
$(document).ready(function () {
var age = "";
$('#dateofbirth').datepicker({
onSelect: function (value, ui) {
var today = new Date();
age = today.getFullYear() - ui.selectedYear;
$('#myAge').val(age);
},
changeMonth: true,
changeYear: true
})
})
</script>