Hey guys

I have a basic js code for some alerts and need to make an alert for showing age calculated from dob.

I have 1 already set up to show dob and now need to show the other 1 for age .

Heres my code:

var dob = document.getElementById("dob");
dob.oninput = function(){
alert("your date of birth is: " + dob.value)
daysOld(dob);
};

function daysOld(dob){
var msPerDay = 1000 * 60 * 60 * 24,
now = new Date(),
diff = now - dob;
alert("age is " + diff)
return diff/msPerDay;
};


Any help would be much appreciated