<inputtype="text"name="textfield"onKeyPress="javascript:alert(event keyCode);returnflase">1 文本框只能输入数字代码(小数点也不能输