仅供参考。
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>二维数组</title> <script type="text/javascript"> var myarr=new Array(); for(i=0;i<3;i++){ myarr[i]=new Array(); for(j=0;j<6;j++){ myarr[i][j]=i*j; document.write("第"+(i+1)+"行、第"+(j+1)+"个值为:"+myarr[i][j]+"<br>"); }} </script> </head> <body> </body> </html>