1. Only enter and paste numbers
<input onkeyup= "This.value=this.value.replace (/\d/g, ')" onafterpaste= "This.value=this.value.replace (/\D/g, ' ) "/>
2. Only numbers can be entered
<input onkeyup= "if (/\d/.test (this.value)) {alert (' Input number only '); this.value= ' 0 ';}" >
3. Only enter numbers and English
<input onkeyup= "Value=value.replace (/[\w]/g, ')"
Onbeforepaste= "Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\d]/g, ')" ><br/ >
4. Enter only numbers and decimal points
<input onkeyup= "Value=value.replace (/[^\d{1,}\.\d{1,}|\d{1,}]/g, ')"/><br/>
5. Only numbers and "-"
<input onkeyup= "Value=value.replace (/[^\w&=]|_/ig, ')" onblur= "Value=value.replace (/[^\w&-]|_/ig, ')" />
6. Prohibit input of Chinese characters
<input style= "ime-mode:disabled" > IME does not convert, but can be pasted on <br/>
7. Only import and paste Chinese characters
<input onkeyup= "Value=value.replace (/[^\u4e00-\u9fa5]/g, ')"
Onbeforepaste= "Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\u4e00-\u9fa5]/g, ')" ><br/>
Restrict input format: Enter only numbers