<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>计时器</title> <script type="text/javascript"> function add() { var time = new Date(); document.getElementById("clock").value = time; var i = setTimeout(add, 1000) } var l = setTimeout(add, 100) </script> </head> <body> <form> <input type="text" id="clock" size="50" width="20" /> <input type="button" value="Stop" onclick="clearTimeout(i)" /> </body> </html>
代码这样
qq_青枣工作室_0
woshiajuana
相关分类