When the input information in js is restricted to numbers only
One: js effect
onkeyup="this.value=this.value.replace(/\D/g,'')"onafterpaste="this.value=this.value.replace(/\D/g,'')" placeholder ="请输入数字类型"
Two: regular effect
Satisfy var zhi=/^\d{3}$/;
if(zhi.test(value))
{
ok
}