document.all.Clock.innerHTML = timeString;
window.setTimeout("tick();", 1000);
}
window.onload = tick;
</script><div id=Clock style="display"></div>
</BODY>
</HTML>
改成这样就ok了.

解决方案 »

  1.   

    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <script>
    function tick()
    {
    var hours, minutes, seconds, ap;
    var intHours, intMinutes, intSeconds;
    var today;
    today = new Date();
    intHours = today.getHours();
    intMinutes = today.getMinutes();
    intSeconds = today.getSeconds();
    if (intHours == 0) 
    {
    hours = "12:";
    ap = "Midnight";

    else if (intHours < 12) 

    hours = intHours+":";
    ap = "A.M.";

    else if (intHours == 12) 
    {
    hours = "12:";
    ap = "Noon";

    else
    {
    hours = intHours + ":";
    ap = "P.M.";
    }
    if (intMinutes < 10)
    {
    minutes = "0"+intMinutes+":";

    else 
    {
    minutes = intMinutes+":";
    }
    if (intSeconds < 10) 
    {
    seconds = "0"+intSeconds+" ";

    else 
    {
    seconds = intSeconds+" ";

    timeString = hours+minutes+seconds+ap;
    document.getElementById("Clock").innerHTML ="<table border='1'><tr><td>" +timeString+"</td></tr></table>";
        window.setTimeout("tick();", 1000);
    }</script>
    </HEAD><BODY onload="tick();">
    <div id="Clock" ></div>
    </BODY>
    </HTML>
    我给你改了一下!
    你最大的错误是吧,"innerHTML"写成了"InnerHTML"