实例
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>document</title> <script type="text/javascript"> for (var i = 1;i <= 9;i++) { for (var j = 1;j <= i;j++) { if(i * j < 10) { document.write(i + "x" + j + "=" + (i * j) + " "); }else { document.write(i + "x" + j + "=" + (i * j) + " "); } }; document.write("<br>"); }; </script> </head> <body> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例