onclick事件点击后为什么使setTimeout(),不断循环
<!DOCTYPE HTML> <html> <head> <script type="text/javascript"> var num=0; function numCount(){ document.getElementById('txt').value=num; num=num+1; setTimeout("numCount()",1000); } </script> </head> <body> <form> <input type="text" id="txt" /> <input type="button" value="Start" /> </form> </body> </html>
点击事件不是只执行一次吗,底层是怎么运作的?