1. Cancel the dashed box when the button is pressed, add the attribute value in input hidefocus or Hidefocus=true <input type= " Submit "value=" Commit "hidefocus=" true "/>2. read-only text box contents, add attribute value in input readonly < Input type= "text" readonly/>3 <input Type= "text" style= "Behavior:url (#default #savehistory);"/>4 <input type= "text" onkeydown= "if (event.keycode==13) event.keycode=9"/>5 only for Chinese (with flashing) <input type= "text" onkeyup= "Value=value.replace (/[-~]/g, ')" onkeydown= "if (event.keycode== Event.keycode=9 "/>6. Only numbers (with flashing) <input type=" text "onkeyup=" value= Value.replace (/[^\d]/g, ') "onbeforepaste=" Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/ [^\d]/g, ')] "/>
<input type= "Text" min= "1" max= "onkeyup=" Value=value.replace (/[^\d]/g, '); value = value > min? Value:min;value = value > Max? Max:value; "/>
7only for numbers (no flashing)<input type= "text" style= "ime-mode:disabled" onkeydown= "if (event.keycode==13) event.keycode=9" onkeypress= "if (( event.keycode<48 | | event.keycode>57)) Event.returnvalue=false "/>8only English and numerals (with flashing) can be entered.<input type= "text" onkeyup= "Value=value.replace (/[\w]/g, ')" onbeforepaste= "Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\d]/g, ') "/>9. Shielded Input Method<input type= "text" name= "url" style= "ime-mode:disabled" onkeydown= "if (event.keycode==13) event.keycode=9"/> 10. Enter only numbers, decimal points, minus signs (-) character (no flashing)<input onkeypress= "if (event.keycode!=46 && event.keycode!=45 && (event.keycode<48 | | event.keycode>57)) Event.returnvalue=false "/>11only two decimal places can be entered, three decimal places (with flashing)<input type= "Text" maxlength= "9" onkeyup= "if (Value.match (/^\d{3}$/)) Value=value.replace (Value,parseint (value/ Value=value.replace (/\.\d*\./g, '. ') "onkeypress=" if ((event.keycode<48 | | event.keycode>57) && event.keycode!=46 && event.keycode!=45 | | Value.match (/^\d{3}$/) | | /\.\d{3}$/.test (value)) {Event.returnvalue=false} "/> 12only numbers and decimal points can be entered.<input type= "text" size= "onkeyup=" This.value=this.value.replace (/[^\d\.) +?/g, ') '/>13can only enter numbers and English<input onkeyup= "Value=value.replace (/[\w]/g, ')" onbeforepaste= "Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\d]/g, ') ">14. You can only enter a number<input onkeyup= "Value=value.replace (/[^\d]/g, ')" onbeforepaste= "Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\d]/g, ') ">15. You can only enter full-width<input onkeyup= "Value=value.replace (/[^\uff00-\uffff]/g, ')" onbeforepaste= "Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\uff00-\uffff]/g, ') ">16. You can only enter Chinese characters<input onkeyup= "Value=value.replace (/[^\u4e00-\u9fa5]/g, ')" onbeforepaste= "Clipboarddata.setdata (' text ', Clipboarddata.getdata (' text '). Replace (/[^\u4e00-\u9fa5]/g, ')) ">
HTML element input restrictions for various inputs