Nonove js timer 计时器
<html> <head> <title> Nonove js timer 计时器 </title> </head> <body> <script language="javascript"> var se,m=0,h=0,s=0,ss=1; function second(){ if((ss%100)==0){s+=1;ss=1;} if(s>0 && (s%60)==0){m+=1;s=0;} if(m>0 && (m%60)==0){h+=1;m=0;} t=h+"时"+m+"分"+s+"秒"+ss+"毫秒"; document.getElementById("showtime").value=t; ss+=1; } function startclock(){se=setInterval("second()",1);} function pauseclock(){clearInterval(se);} function stopclock(){clearInterval(se);ss=1;m=h=s=0;} </script> <input name="s" type="button" value="开始计时" onclick="startclock()"> <input name="s" type="button" value="暂停计时" onclick="pauseclock()"> <input name="s" type="button" value="停止计时" onclick="stopclock()"> <input name="showtime" style="color:#ff0000;width:200px;" id="showtime" type="text" value="0时0分0秒"> </body> </html>
积跬步以致千里,积小流以成江海。
2016年5月之前的博文发布于51cto,链接地址:shamrock.blog.51cto.com
2016年5月之后博文发布与cnblogs上。
Github地址 https://github.com/umgsai
Keep moving~!!!
2016年5月之前的博文发布于51cto,链接地址:shamrock.blog.51cto.com
2016年5月之后博文发布与cnblogs上。
Github地址 https://github.com/umgsai
Keep moving~!!!