html input标签 要求只能输入纯数字
在input标签添加以下代码即可
oninput = "value=value.replace(/[^\d]/g,'')"
<input type="text" oninput = "value=value.replace(/[^\d]/g,'')">
oninput = "value=value.replace(/[^\d]/g,'')"
<input type="text" oninput = "value=value.replace(/[^\d]/g,'')">