身份证号合法性验证
//是否满18岁 function in18(birthYear,birthMonth,birthDay) { var now = new Date(); var year = now.getFullYear(); var month = now.getMonth() +1; var day = now.getDate(); var age = year - birthYear; var count = 0; if(age<18){ count ++ ; }; if(age == 18){ if(birthMonth > month){ count ++ ; }else if(birthMonth == month){ if(birthDay > day){ count ++ ; } }; }; return count; } 细校验(带平年、闰年、31天的月份、2月的天数,以及1920以后的人等的) /^[1-9]\d{5}((((19|[2-9][0-9])\d{2})(0?[13578]|1[02])(0?[1-9]|[12][0-9]|3[01]))|(((19|[2-9][0-9])\d{2})(0?[13456789]|1[012])(0?[1-9]|[12][0-9]|30))|(((19|[2-9][0-9])\d{2})0?2(0?[1-9]|1[0-9]|2[0