<script language ="javascript" type ="text/javascript"> var second=0; var minute=0; var hour=0; window .setInterval ("OnlineStayTimes();",1000); function OnlineStayTimes() { second ++; if(second ==60){second =0;minute +=1;} if(minute ==60){minute =0;hour +=1;} var tm=hour+"小时"+minute +"分钟"+second +"秒" document.getElementById ("time").innerHTML=tm; } </script>