MediaWiki:AgeCheck

function check_dob {   var month = document.getElementById('month').value; var day = document.getElementById('day').value; var year = document.getElementById('year').value; var dbDate = year+'-'+month+'-'+day; var today = new Date; var birthDate = new Date(dbDate); var age = today.getFullYear - birthDate.getFullYear; var m = today.getMonth - birthDate.getMonth; if (m < 0 || (m === 0 && today.getDate < birthDate.getDate)) { age--; }

if(age<=20) {       alert("You are under "+age+" Year") } }