$("#ipt").bind('input propertychange',function(){ var value=$(this).val().replace(/\s/g,'').replace(/(\d{4})(?=\d)/g,"$1 "); $(this).val(value) })
$("#ipt").bind('input propertychange',function(){ var value=$(this).val().replace(/\s/g,'').replace(/(\d{4})(?=\d)/g,"$1 "); $(this).val(value) })
转载于:https://www.cnblogs.com/sugege/p/9881938.html