具体代码如下所示: [removed] function checkid(iden,year,month,day){ if (iden.value.length==15) { if ((iden.value.lastIndexOf(month.value+day.value))==8) { return true; } return false; } if (iden.value.length==18) { if ((iden.value.indexOf(year.value+month.value+day.value))==6) { return