js匹配手机号

   /*匹配手机号*/
    function checkPhone(){
        var phoneExp = /^1[34578]\d{9}$/;
        var check;
        var phone = $(“#phone”).val();
        if (phone.length<11||!phoneExp.test(phone)) {
            $(“.phoneNum i”).remove();
            $(“.phoneBox .msg”).html(“请输入正确的手机号码”);
            $(“#phone”).focus();
            check = false;
        } else {
            $(“.phoneBox .msg”).html(“”);
            $(“.phoneNum”).append(“<i class=’iconfont icon-duigou1′></i>”);
            check = true;
        }
        return check;
    }

0
0
Tags:

发表回复

Your email address will not be published. Required fields are marked *.

*
*