常用键盘鼠标判断

 function check(e) 
  { 
          var key = window.event.keyCode; 
            if(key<48 || key>57) 
             { 
                   alert("只能够输入数字!"); 
                   window.event.keyCode = 0; 
              } 
   }


onkeypress="check(this)"



 <script language="JavaScript">
  function closeit()
  {
  setTimeout("self.close()",10000) //毫秒
  }
  </script>
<body onload="closeit()">
posted on 2005-11-18 13:31  泽来  阅读(283)  评论(0编辑  收藏  举报