Document
<script type="text/javascript">
window.onload=function(){
function show() {
var date = new Date();
var hour = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var text = "现在是北京时间:"+hour+":"+minutes+":"+seconds+"!!";
document.getElementById("stime").innerHTML=text;
}
setInterval("show()",1000);
}
</script>
5 回答
慕工程0101907
TA贡献1887条经验 获得超5个赞
setInterval(function(){ show(); },1000); //or // setInterval(show, 1000);
添加回答
举报
0/150
提交
取消