<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<script>
function newTime(){
var time=new Date();
var temp=time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
document.getElementById("time").innerHTML=temp;
}
setInterval(newTime,1000);
</script>
</head>
<body>
<span id="time"></span>
</body>
</html>