[Solved] Date of birth JavaScript function stopped working


Looked for a completely new bit of script and below is an example of a working date of birth function:

<p>Xxxx 
<script>
function getAge(DOB) {
var today = new Date();
var birthDate = new Date(DOB);
var age = today.getFullYear() - birthDate.getFullYear();
var m = today.getMonth() - birthDate.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age = age - 1;
}
return age;
}
document.write(getAge("06/13/2005"));
</script>
years' xxxx.</p>

solved Date of birth JavaScript function stopped working