调试运行
<html> <head> <title>重复执行(for)</title> </head> <body> <script language="javascript"> <!-- sum = 0; for(i=1;i<=10;i++){ sum+=i; } document.write("从1加到10的结果为:",sum); //--> </script> </body> </html>