I need to validate if the age for a alcohol website. And what I need is all here. I\'m nearly there but I\'m not sure is correct . Locally doesn\'t work. I need the
Use http://timeago.yarp.com plugin.
let them type in their date of birth and then you can use
jQuery.timeago("2008-07-17"); //=> "3 years ago"
if that number >= 21 they are of age
for the cookie you can use this plugin https://github.com/carhartl/jquery-cookie
$.cookie('the_cookie', 'the_value'); //set cookie
$.cookie('the_cookie'); // read cookie
SECOND EDIT: full source http://jsfiddle.net/bhdry/