调试运行
<html> <head> <title>将1~10之间的奇偶数分开</title> </head> <body> <script language="javascript"> <!-- for(i=1;i<=10;i++){ if((i % 2 ) == 0){ document.write("i=",i,"偶数<br>"); }else{ document.write("i=",i,"奇数<br>"); } } //--> </script> </body> </html>