JS输入银行卡号,4位自动加空格

来源:互联网 发布:unity3d动态模型 编辑:程序博客网 时间:2024/06/11 21:11
<input  type="text" onkeyup="this.value =this.value.replace(/\s/g,'').replace(/[^\d]/g,'').replace(/(\d{4})(?=\d)/g,'$1 ');">

0 0