Posted on 2008-10-30 12:36
鱼跃于渊 阅读(650)
评论(0) 编辑 收藏 所属分类:
javascript相关
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题页</title>
<script type="text/javascript">
var leftTime = 10;
window.onload = initAll;
function initAll()
{
show();
}
function show()
{
document.getElementById("btntest").value=leftTime;
leftTime--;
if(leftTime>0)
{
setTimeout("show()",1000);
}
else
{
document.getElementById("btntest").value="OK !";
document.form1.btntest.disabled=false;
}
}
</script>
</head>
<body>
<form action="" name="form1">
<input size="30" type="button" name="btntest" id="btntest" value="" disabled="true" />
</form>
</body>
</html>