HTML现在对一个程序人原来说是非常重要的,几乎可以算是各种程序的基础了,所以学号HTML是从事互联网工作必备的。今天文章就给大家介绍通过使用HTML怎么去制作动态时钟,这也是一个非常不错的制作效果。感兴趣的下面一起来看看。
用html写一个动态网页时钟,代码如下所示:
时钟特效 <script type="text/javascript"> function disptime(){ var today=new Date(); var hh=today.getHours(); var mm=today.getMinutes(); var ss = today.getSeconds(); document.getElementById("myclock").innerHTML="现在是—"+hh+":"+mm+":"+ss+"
" } //setInterval()方法可以按照指定的周期调用函数或计算表达式 var mytime = setInterval("disptime()",1000); </script>
word-spacing:0px;text-transform:none;font-weight:normal;color:#000000;font-style:normal;orphans:2;widows:2;letter-spacing:normal;text-indent:0px;font-variant-ligatures:normal;font-variant-caps:normal;-webkit-text-stroke-width:0px;" src="http://img.111cn.net/attachment/art/145680/854737885c.png" />
http://m.bbyears.com/jiaocheng/135873.html
推荐访问:用html写表格 用html写表单