<html>
<head>
<title>sb</title>
<script language=vbs>
function ksh()
shj=document.f1.aa.value
if shj="" then
alert("请输入秒数")
document.f1.aa.focus
exit function
elseif isnumeric(shj)=false then
alert("必须输入数字")
document.f1.aa.select
exit function
elseif shj<=0 then
alert("时间已经到了")
exit function
end if
shj=shj-1
document.f1.aa.value=shj
settimeout"ksh",1000,"vbs"
end function
</script>
</head>
<body BGCOLOR="#FFFFFF">
<form name=f1>倒计时还剩
<input type="text" name="aa" size=5
style="color=red;font-size=20;font-weight=700;font-family:宋体">秒
<input type="button" value=开始
onclick=ksh>
</form>
</body>
</html>
转载于:https://www.cnblogs.com/liuzhuqing/archive/2010/12/09/7481256.html