一进页面就开始计时,显示分钟
计时?显示分钟
------解决方案--------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>test.html</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script>
$(function(){
var min = 1;//默认从0分开始计时
setInterval(function(){//每隔60s,分钟加1
++min;
$('#clock').html('开考'+min+'分钟');
},60000);
});
</script>
</head>
<body>
<div id="clock"></div>
</body>
</html>