把:hous=now.getHours();改为:hours=now.getHours();
把:seconds=now.getSceonds();改为:seconds=now.getSeconds();

解决方案 »

  1.   

    <html>
    <title>一个数字的时钟</title>
    <head>
    <script language="javascript">
    var timeStr,dateStr;
    function clock()
    {
    now=new Date();
    hours=now.getHours();
    minutes=now.getMinutes();
    seconds=now.getSeconds();
    timeStr+=""+hours;
    timeStr=timeStr+((minutes<10) ? ":0":":")+minutes;
    timeStr=timeStr+((seconds<10) ? ":0":":")+seconds;
    document.clock.time.value=timeStr;date=now.getDate();
    month=now.getMonth()+1;
    year=now.getYear;
    dateStr+=""+month;
    dateStr=dateStr+((date<10) ? "/0":"/")+date;
    dateStr+="/"+year;
    document.clock.date.value=dateStr;
    Timer=setTimeout("clock()",1000);
    }
    </script>
    </head>
    <body onLoad="clock()">
    <form name="clock">
    Time:
    <input type="text" name="time" size="8" value=""><br>
    Date:
    <input type="text" name="date" size="8" value="">
    </form>
    </body>
    </html>
    改好了,给分吧,老兄!