js限制只能输入数字...
时间:2010-08-13 来源:stitch_kwok
<script type="text/javascript"> function checkNumber() { if(!(((window.event.keyCode>=48)&&(window.event.keyCode<=57))||(window.event.keyCode==13)||(window.event.keyCode==46)||(window.event.keyCode==45))) { window.event.keyCode=0; } } </script>
<input type="text" id="Data" onkeypress="checkNumber()" />
相关阅读 更多 +