Find a lot on the Internet, not practical, or compatible with the problem, this is okay!
<input> The keyboard and Chinese input are prohibited, but it cannot be used with ReadOnly and also needs to be compatible with IE and FF. It costs it in order to complete this function. Hehe, here is the use of future use; in addition, you prohibit the adhesion of onPaste = "Return false "
Copy code code as follows:
<! Doctype html public "-// W3C // dtd html 4.0 transitional // en">>
<Html>
<Head>
<Title> New Document </Title>
<script>
// Style style = "IME-MODE: Disabled" prohibits Chinese input
Function Nopermitinput (E) {
var EVT = Window.event || E;
if (isie ()) {{
EVT.Returnvalue = false; // IE prohibits keyboard input
} Else {
EVT.PreventDefault (); // Fire Fox prohibits keyboard input
}
}
function isie () {
if (if Window.navigator.useragent.tologyCase (). Indexof ("msie")> = 1)
Return true;
else
Return false;
}
</script>
</Head>
<body>
Prohibit keyboard key input and Chinese input
<input type = "text" value = "" style = "IME-Mode: Disabled" Onepress = "NoperMitinput (EVENT)">
</Body>
</Html>