有问题,
 你的函数名为stime,那个div的id就应该不能取这个名字,另外用一个
 改动了一点点:
 <div id="dddd" style="position:absolute; left:157px; top:68px; width:310px; height:39px; z-index:1"></div>
<script language=javascript>
function stime(){
   var d, s = "当前本地时间为: ";
   var c = ":";
   d = new Date();
   s += (d.getMonth() + 1) + "/";
   s += d.getDate() + "/";
   s += d.getYear()+"  ";
   s += d.getHours() + c;
   s += d.getMinutes() + c;
   s += d.getSeconds();
   dddd.innerHTML=s;
   setTimeout("stime()",1000);   
}
stime();</script>

解决方案 »

  1.   

    http://xiuxianjiari.nease.net/mfdm/sj01.html
      

  2.   

    但是我的显示里面,它不刷新,settimeout有问题吗?
      

  3.   

    setTimeout("stime()",1000);
    只执行一次的。
    同意楼上的写法,你也可以用setInterval("stime()",1000);另:函数名与div的id是可同名的,你可以用document.all.id调用。
      

  4.   

    try:<script>
    function stime(){
       var d, s = "当前本地时间为: ";
       var c = ":";
       d = new Date();
       s += (d.getMonth() + 1) + "/";
       s += d.getDate() + "/";
       s += d.getYear()+"  ";
       s += d.getHours() + c;
       s += d.getMinutes() + c;
       s += d.getSeconds();
       setTimeout("stime()",1000);
       stime.innerHTML=s;
    }
    </script>
    <body onload=stime()>