常用键盘鼠标判断
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()">
{
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()">