HTML网页上这么写
<input type="text" style="ime-mode:disabled;" onpaste="return false;" onkeypress="keyPress()" />
function keyPress() { var keycode = event.keyCode; if ((keycode >= 48) && (keycode <= 57)) { event.returnValue = true; } else { event.returnValue = false; } };