<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>JS显示与隐藏</title></head><body ><script type="text/javascript"> function getDate() { var nowTime=new Date(); var strTime=nowTime.toLocaleString(); var a=document.getElementById("myDiv"); a.innerHTML=strTime; }function startTime() { window.setInterval("getDate()",1000);} </script><div id="myDiv"></div></body></html>
原文地址:https://www.cnblogs.com/god1/p/12116113.html
时间: 2025-01-17 17:53:13