时间:2021-07-01 10:21:17 帮助过:2人阅读
<html>
<head>
<script language = "javascript" type = "text/javascript">
function showTime(){
//在元素间的文本就是通过 对象 .innerText
document.getElementById("mytime").innerText = new Date().toLocaleString();
}
setInterval("showTime()",1000);
</script>
</head>
<body>
<span id = "mytime"></span>
</body>
</html>