<form name="ff"> phone:<input type="text" id="123" name="qq"> </form> <script> ff.qq.onchange = function(){ this.value = check_phone(this.value); }; function check_phone(Phone){ if ( /^\s*1[34578]{1}\d{9}\s*$/.test(Phone) ) return Phone.replace(/(^\s*)|(\s*$)/g, ""); check_phone(prompt('请输入正确的手机号:')); } </script>
怎么改才对?
anlun214
相关分类