This article collects a few JS input boxes can only input Chinese, English, numerals, @ symbols and. Yes, the first one is only English. The second is to enter only Chinese, English, numerals, @ symbols and. Symbols, the third is to enter only English letters and numbers, can not enter Chinese and so on.
can only enter English
<input type= "text" onkeyup= "Value=value.replace (/[^a-za-z]/g, ')" >
<input type= "text" onkeyup= "Value=value.replace (/[^a-za-z]/g, ')" > can only enter Chinese, English, numerals, @ symbols and. Symbols
<input type= "text" onkeyup= "Value=value.replace (/[^a-za-z0-9u4e00-u9fa5@.] G, ">
Only letters and Chinese characters can be entered
<input onkeyup= "Value=value.replace (/[d]/g,") "Onbeforepaste=" Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[d]/g, ') "maxlength=10 name=" Numbers ">5. You can only enter English letters and numbers, you cannot enter Chinese
<input onkeyup= "Value=value.replace (/[^w./]/ig, ')" >6. can only enter numbers and English <font color= "Red" >chun</font>
<input onkeyup= "Value=value.replace (/[^d|chun]/g,") ">