我用js写了一个时间,代代码如下<div id="sj"  style="float:right; width:200px; height:10px; margin-top:6px; margin-left:5px; color:#FFFFFF;">
<script>setInterval("sj.innerHTML=new Date().toLocaleString();",1000);
</script>
</div>在ie6里面显示正常,为什么在ie8里面显示不正常,怎么解决?
具体情况如下图

解决方案 »

  1.   

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    </head><body>
    <div id="sj"  style="float:right; width:200px; height:10px; margin-top:6px; margin-left:5px; color:#000;">
        <script>setInterval("sj.innerHTML=new Date().toLocaleString();",1000);
        </script>
    </div></body>
    </html>
    我试了下 ie8正常