求javascript倒计时代码
运行后出现10987654321的倒计时。要在窗口中显示!!!!!!!!!!!!!!!!...
运行后出现10 9 8 7 6 5 4 3 2 1的倒计时。要在窗口中显示!!!!!!!!!!!!!!!!
展开
2个回答
展开全部
<script laugnage="javascript">
var temp=10
function oJump()
{
temp-=1
document.getElementById("myclock").innerText=temp;
if(temp==0)
{clearTimeout(obj)}
}
var obj=setInterval("oJump()",1000);
</script>
<span id="myclock" >10</span>
var temp=10
function oJump()
{
temp-=1
document.getElementById("myclock").innerText=temp;
if(temp==0)
{clearTimeout(obj)}
}
var obj=setInterval("oJump()",1000);
</script>
<span id="myclock" >10</span>
展开全部
<script language=javascript>
var sj = 10;
var st;
function djs() {
if (sj==0) {
clearTimeout(st);
alert("时间到");
} else {
document.all.showsj.value = sj;
sj -= 1;
st = setTimeout("djs()",1000);
}
}
</script>
<body onload="djs();">
<input type=text name="showsj" style="font-size:36px; border:0px; font-family:arial black;">
</body>
var sj = 10;
var st;
function djs() {
if (sj==0) {
clearTimeout(st);
alert("时间到");
} else {
document.all.showsj.value = sj;
sj -= 1;
st = setTimeout("djs()",1000);
}
}
</script>
<body onload="djs();">
<input type=text name="showsj" style="font-size:36px; border:0px; font-family:arial black;">
</body>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询