首页 > 编程语言 > 详细

利用javascript在当前页面显示时间

时间:2014-10-19 01:13:56      阅读:296      评论:0      收藏:0      [点我收藏+]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Constellation</title>
<script type="text/javascript">
function timer()
{
    var time=new Date();
    document.getElementById("currentTime").innerHTML="当前时间:"+time;
}
setInterval("timer()", 1000);
</script>
</head>
<body>
<div  id="currentTime">当前时间:时间载入中......</div>
<div>
</body>
</html>

利用javascript在当前页面显示时间

原文:http://www.cnblogs.com/whlei/p/4034093.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!