鄙人不才,繼續(xù)暫停,繼續(xù)暫停
<!DOCTYPE?HTML>
<html>
????<head>
????????<meta?http-equiv="Content-Type"?content="text/html;?charset=utf-8">
????????<title>計時器</title>
????????<script?type="text/javascript">
???????????function?clock(){
?????????????????var?time=new?Date();
?????????????????document.getElementById("clock").value?=?time;
???????????}
???????????var?i;
???????????function?start()?{???
?????????????i?=?setInterval("clock()",100);
???????????}
???????????i=setInterval("clock()",100);
????????</script>
????</head>
????<body>
??????<form>
??????????<input?type="text"?id="clock"?size="50"??/>
??????????<input?type="button"?value="Stop"?onclick="clearInterval(i)"?/>
??????????<input?type="button"?value="Start"?onclick="start()"?/>
??????????
??????</form>
????</body>
</html>
2020-10-16
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>計時器</title>
<script type="text/javascript">
? ?var? s=false;
? ?function clock(){
? ? ? var time=new Date();? ? ? ? ? ? ? ? ??
? ? ? document.getElementById("clock").value = time;
? ?}
? ? ?var i=setInterval(clock,1000);
? ? ?function fc()
? ? ?{
? ? ? ? ?if(s)
? ? ? ? ?{
? ? ? ? ? ? ?s=false;
? ? ? ? ? ? ?i=setInterval(clock,1000)
? ? ? ? ?}else
? ? ? ? ?{
? ? ? ? ? ? ?s=true;
? ? ? ? ? ? ?clearInterval(i);
? ? ? ? ?}
? ? ?}
</script>
</head>
<body>
? <form>
? ? <input type="text" id="clock" size="50"? />
? ? <input type="button" value="Stop" onclick="fc()" />
? </form>
</body>
</html>
2020-08-15
再點停止就失效了
2020-06-08
看到有好多人問繼續(xù)暫停繼續(xù)暫停怎么搞,就這么搞吧,馬馬虎虎