<script language=javascript>function onlyNum(){ if(!((event.keyCode>=48&&event.keyCode<=57)||(event.keyCode>=96&&event.keyCode<=105)))//考虑小键盘上的数字键 event.returnValue=false;}</script><input onkeydown="onlyNum();">