【jQuery】input框输入手机号自动填充空格

<input type="tel" id="tel">
$("#tel").keyup(function(){
     _self = $(this);
     if(_self.val().length == 3 || _self.val().length == 8){
           var str = _self.val()+" ";
           _self.val(str);
    }
});
原文地址:https://www.cnblogs.com/BearLee/p/8559506.html