素衣清颜淡若尘

js验证手机号码

电脑版发表于:2020/6/29 20:29

js:

function isPoneAvailable($poneInput) {
            var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
            if (!myreg.test($poneInput.val())) {
                return false;
            } else {
                return true;
            }
        }

1:以1为开头;

2:第二位可为3,4,5,7,8,中的任意一位;

3:最后以0-9的9个整数结尾。


关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢