您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

JavaScript在网页中动态显示当前日期和时间

2025/8/15 17:37:50发布10次查看
javascript代码:在网页中动态显示当前日期和时间
<html> <head> <title>在网页中动态显示当前日期和时间</title> </head> <body onload="showtime()"> <script language="javascript"> function showtime(){ var thetime=new date(); // 初始化日期对象 document.getelementbyid( "timearea").innertext = thetime.tolocalestring(); window.settimeout( "showtime()",1000); //settimeout (表达式,延时时间)其中延时时间以豪秒为单位(1000ms=1s) } </script> <div id="timearea" align="center"> </div> </body> </html>
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product