JS手机号码检验正则表达式(积分商城)

function checkPhone(){ 
    var phone = document.getElementById('phone').value;
    if(!(/^1(3|4|5|7|8)\d{9}$/.test(phone))){ 
        alert("手机号码有误,请重填");  
        return false; 
    } 
}
参考:http://caibaojian.com/regexp-example.html

http://caibaojian.com/phone-regexp.html

https://www.jianshu.com/p/e8477fdccbe9
posted @ 2018-10-26 16:53  南夏啊南夏  阅读(167)  评论(0编辑  收藏  举报