این کد برای بکار بردن ساعت و تاریخ هست خیلی جالبه و به این صورت در میاد
<head> <!-- TWO STEPS TO INSTALL TILL 2000: 1. Add the onLoad event handler to the BODY tag 2. Put the designated code into the BODY of your HTML document --> <!-- STEP ONE: Add the onLoad event handler to the BODY tag --> <html> <head> <title>E:clocksstatusdate_.htm</title> </head> <body onLoad="startclock()"> <!-- STEP TWO: Put this code into the BODY of your HTML document --> <div align="center"><center> <table BORDER="4" CELLPADDING="0.5" CELLSPACING="0.5"> <tr> <td><b><form name="frm"> <div align="center" align="middle"> <dd><input type="textarea" name="left" size="75" value> </dd> </div></b> </form> </td> </tr> </table> </center></div><script LANGUAGE="JavaScript"> <!-- Original: Tomer Shiran and Yehuda Shiran. <!--Total Java Scripts 99 - Next Step Software--> <!-- Begin var Temp2; var timerID = null; var timerRunning = false; function showtime() { now = new Date(); var CurHour = now.getHours(); var CurMinute = now.getMinutes(); var CurMonth = now.getMonth(); var CurDate = now.getDate(); var CurYear = now.getYear(); var CurSecond = now.getSeconds(); now = null; Hourleft = 23 - CurHour Minuteleft = 59 - CurMinute Secondleft = 59 - CurSecond var Yearleft = 99 - CurYear var Monthleft = 11 - CurMonth var Dateleft = 30 - CurDate if (Yearleft!=1) {var ys="s"} else {var ys=""}; if (Monthleft!=1) {var mos="s"} else {var mos=""} if (Dateleft!=1) {var ds="s"} else {var ds=""} if (Hourleft!=1) {var hs="s"} else {var hs=""} if (Minuteleft!=1) {var mis="s"} else {var mis=""} if (Secondleft!=1) {var ss="s"} else {var ss=""} Temp2='Still '+Yearleft+' year'+ys+', '+Monthleft+' month'+mos+', '+Dateleft+' day'+ds+', '+Hourleft+' hour'+hs+', '+Minuteleft+' minute'+mis+', '+Secondleft+' second'+ss+' left until the year 2000! ' Temp3=Yearleft+' year'+ys+', '+Monthleft+' month'+mos+', '+Dateleft+' day'+ds+', '+Hourleft+' hour'+hs+', '+Minuteleft+' minute'+mis+', and '+Secondleft+' seconds till 2000!'; window.status=Temp2; document.frm.left.value=Temp3; timerID = setTimeout("showtime()",1000); timerRunning = true; } var timerID = null; var timerRunning = false; function stopclock() { if(timerRunning) clearTimeout(timerID); timerRunning = false; } function startclock() { stopclock(); showtime(); } // End --> </script> <!-- Script Size: 2.31 KB --> </body> </html> </head></body> </html>