87,910
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>时钟特效</title>
</head>
<script type="text/javascript">
function disptime(){
var today=new Date();
var hh=today.getHours();
var mm=today.getMinutes();
var ss = today.getSeconds();
document.getElementById("myclock").innerHTML="<p>"+hh+":"+mm+":"+ss+"</p>"
}
//setInterval()
var mytime = setInterval("disptime()",1000);
</script>
<body onload="disptime()">
<div id="myclock"></div>
</body>
</html>