刚知道js里面有闭包这回事,貌似落伍了不是一点点了>_< <html> <head> <title>javascript closure</title> <script language = "javascript"> function a () { var i = 0; return function () { alert ( ++i ); } } c = a (); </script> </head> <body> <input id="myBtn" type="button" value="closure" οnclick="c()" /> </body> </html>