样式示例:
现在时间是:14:53:39
以下是代码片段:
<div id="time" align=center>time</div>
<script language="javascript">
function time1(){ now=new Date(); h = now.getHours()+":"; //得到小时 m = now.getMinutes()+":"; //得到分钟 s = now.getSeconds(); //得到秒 document.all["time"].innerHTML="现在时间是:"+h+m+s;}
setInterval('time1()',100);
</script>