ITPub博客

首页 > 应用开发 > > 为什么清空这行代码没起作用 我需要的是 没有通过正则 input 清空

为什么清空这行代码没起作用 我需要的是 没有通过正则 input 清空

作者:freewill 时间:2019-10-21 13:49:59 0 删除 编辑

 $("input[name='phonf']").blur(function () {

        if ($(this).val() == '') {

            $(this).attr('placeholder', '联系手机不能为空')

            return

        } else {

            $(this).attr('placeholder', '')

        }

        var reg1 = /^1[345678]\d{9}$/;

        if (reg1.test($(".phonf").val())) {

            return

        } else {

 $(".phonf").val()==""

            alert("错误");

        }

    });

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1594/viewspace-3153213/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-15

  • 博文量
    113
  • 访问量
    1012