为什么这样写,输出的是11? document.write放大括号里面和外面有什么不同?
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>if...else</title> <script type="text/JavaScript"> var mymoney,sum=0;//mymoney变量存放不同面值,sum总计 for(mymoney=1;mymoney<=10;mymoney++) { } document.write("sum合计:"+mymoney+"<br />"); </script></head><body></body></html>