onkeyup="this.value=this.value.replace(/\D/g,''),
2021-07-29 84次 反馈错误 加入收藏 正确率 : 100%
题目内容:
onkeyup="this.value=this.value.replace(/\D/g,''),
优质解答
首先这是个正则式验证,用来验证输入值的规则;
当输入值的键盘抬起时触发这个事件.this.value表示此输入框的值,/\D/g为正则表达式,用来匹配所有非数字字符;
此句功能为:将输入值为非数字的字符替换为空;
这个只要你新建个页面测试下就能理解的;
本题链接: