$(function(){
//验证手机号
var mobilePhone
= '12345678';
var reg =
/^0?1[358]\d{9}$/;
if
(reg.test(mobile_phone)){
alert('正确');
}else{
alert('不符合规则');
}
//验证邮箱
var mailCheck= 'test@163.com';
var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
var result = reg.test(mailCheck);
alert(result);
})
//验证是不是数字
var $number = '123n',
$number2 = 123;
if(isNaN($number)){alert($number)}
if(isNaN($number2)){alert($number2)}