5 回答
A空城
TA贡献14条经验 获得超3个赞
<body onload="timedMsg()"> <div ID="div"></div> <script> function timedMsg(){ var d = new Date(); var t = d.getDate(); var m = d.getMonth()+1; var y = d.getYear()+1900; var h = d.getHours(); var f = d.getMinutes(); var s = d.getSeconds(); m = m < 10 ? ('0' + m) : m; t = t < 10 ? ('0' + t) : t; h = h < 10 ? ('0' + h) : h; f = f < 10 ? ('0' + f) : f; s = s < 10 ? ('0' + s) : s; var jieguo = y+'-'+m+'-'+t+' '+h+':'+f+':'+s; document.getElementById('div').innerHTML = jieguo; setTimeout("timedMsg()", 1000); } </script> </body>
这个不是CSS可以写出来的,要用JS,以上是代码
- 5 回答
- 0 关注
- 2180 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消