複製程式碼 程式碼如下: BR>"http://www.w3.org/TR/html4/loose.dtd"> 顯示停留時間 您在本站已停留: <BR>var second=0; <BR>var minute=0; <BR>var hour=0; <BR>window.setTimeout("interval();",1000 ); <BR>function interval() <BR>{ <BR>second ; <BR>if(second==60) <BR>{ <BR>second=0;minute =1; <BR>} <BR> if(minute==60) <BR>{ <BR>minute=0;hour =1; <BR>} <BR>document.form1.textarea.value = hour "" minute "分" second "秒"; <BR>window.setTimeout("interval();",1000); <BR>} <BR>