window.onload =function() { document.getElementByIdx_x_x("test").onkeyup =function() { this.value =this.value.replace(/\s/g,'').replace(/(\d{4})(?=\d)/g,"$1 ");; }; };
转载请注明:有爱前端 » JS 输入银行卡号,4位自动加空格(转)
window.onload =function() { document.getElementByIdx_x_x("test").onkeyup =function() { this.value =this.value.replace(/\s/g,'').replace(/(\d{4})(?=\d)/g,"$1 ");; }; };
转载请注明:有爱前端 » JS 输入银行卡号,4位自动加空格(转)