hiit

手机号验证正则

/^1[3-9]\d{9}$/

js的例子 isphone.html

<html>
<body>
<input id="Tel" type="text" value="18988889999">
<button onclick="myFunction()">验证号码</button>
<script>
function myFunction(){
  isPhone(document.getElementById("Tel").value);
}
function isPhone(phone) {
            var myreg=/^1[3-9]\d{9}$/;
            if (!myreg.test(phone)) {
                alert(\'no\');
            } else {
                alert(\'yes\');
            }
        }
</script>
</body>
</html>

 用自己私人的服务器来测试吧,99买阿里云

分类:

技术点:

相关文章:

  • 2022-01-11
  • 2021-11-30
  • 2022-02-01
  • 2021-11-30
  • 2022-12-23
  • 2022-02-04
  • 2021-12-30
猜你喜欢
  • 2021-11-27
  • 2021-11-20
  • 2021-12-23
  • 2021-10-22
  • 2022-12-23
  • 2021-10-02
  • 2022-02-03
相关资源
相似解决方案