This article mainly introduces & lt; input & gt; prohibiting keyboard and Chinese input, but you can click. If you need a friend, please refer to it. I hope you can find a lot of help on the Internet, which is not practical or incompatible. This is fine!
Keyboard and Chinese input are prohibited, but readonly is not available and must be compatible with ie and ff. It takes a lot of effort to complete this function; in addition, do not paste onpaste = "return false"
The Code is as follows:
New Document
Script
// Style = "ime-mode: disabled" Disable Chinese Input
Function noPermitInput (e ){
Var evt = window. event | e;
If (isIE ()){
Evt. returnValue = false; // disable keyboard input in ie
} Else {
Evt. preventDefault (); // fire fox disables keyboard input
}
}
Function isIE (){
If (window. navigator. userAgent. toLowerCase (). indexOf ("msie")> = 1)
Return true;
Else
Return false;
}
Script
Disable keyboard and Chinese Input