这段代码假定环境是一个ID为age-form的”form”,三个ID分别为”day”,”month”,”year”。
var currdate = new Date();
currdate.setFullYear(currdate.getFullYear() - age);
if ((currdate - mydate) < 0){
alert("Sorry,only persons over the age of " + age + " may enter this site");
return false;
}
return true;
});
原文链接:https://www.f2er.com/jquery/49986.htmlcurrdate.setFullYear(currdate.getFullYear() - age);
if ((currdate - mydate) < 0){
alert("Sorry,only persons over the age of " + age + " may enter this site");
return false;
}
return true;
});