JavaScript - Over 18 Check
// var userAge = +new Date( $('#age-input').val() ); var userAge = +new Date('1997-01-21'); var eighteenYearsAgo = (+new Date()) - (31560000000 * 18); var validAge = userAge <= eighteenYearsAgo;