标签:alert null card val blur turn 判断 put trim
id为input的id
// 判断身份证是否正确
$(‘#iscard‘).blur(function() {
var card = $.trim($("#iscard").val());
if(card.match(/^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$/) == null) {
alert(‘身份证号格式错误‘);
return;
}
});
标签:alert null card val blur turn 判断 put trim
原文地址:http://www.cnblogs.com/yongwang/p/6950918.html