//根据身份证获取出生日期function getBirthDate(idCard) { var birthday = ""; if(idCard != null && idCard != ""){ if(idCard.length == 15){ birthday = "19"+idCard.substr(6,6); } else if(idCard.length == 18){ birthday = idCard.substr(6,8); }birthday = birthday.replace(/(.{4})(.{2})/,"$1-$2-"); } return birthday; }// 验证身份证function isCardNo(card) {var pattern = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;return pattern.test(card);}
100字范文,内容丰富有趣,生活中的好帮手!