倒计时 考试 提交数据
function CurrTime() { document.getElementById("currTime").innerHTML = "15:00"; setTimeout(uceOneSec, 1000); }
function uceOneSec() { var currTime = document.getElementById("currTime"); var tempTime = currTime.innerHTML.split(":"); var minute = tempTime[0]; var second = tempTime[1]; if (second >= 1) { second = (second - 1 > 9) ? (second - 1) : "0" + (second - 1); } else { second = 59; if (minute >= 1) { minute = (minute - 1 > 9) ? (minute - 1) : "0" + (minute - 1); } else { } } document.getElementById("currTime").innerHTML = minute + ":" + second; if (minute == 0 && second == 0) { //执行提交事件
} else { setTimeout(uceOneSec, 1000); } }
<body onload='CurrTime()'>
<div style="display: block"> 考试时间<span style="color: #FF3300; font-size: medium"><asp:Label ID="lblExamTime" runat="server" Text="15分钟"></asp:Label></span> <span id="time" >剩余时间:</span> <span id="currTime" style="color: #FF3300;">15 </span> </div></body>