<!DOCTYPE HTML> <html > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>流程控制语句</title> </head> <body> <div id="con"> <script type="text/javascript"> var A=[ ['小A','女','大一',21], ['小B','男','大三',23], ['小C','男','大四',24], ['小D','女','大一',21], ['小E','女','大四',22], ['小F','男','大一',21], ['小G','女','大二',22], ['小H','女','大三',20], ['小I','女','大一',20], ['小J','男','大三',20] ]; //将以上数组通过join()方法全部转换为字符串并输出 for(var i=0;i<A.length;i++){ var B=A[i].join("-") document.write(B) } </script> </div> <script type="text/javascript"> //提取上面的文本内容并输出 document.write(document.getElementById("con").innerHTML) </script> </body> </html>
结果
按照自己的节奏前行
猎豹012
迁就LOSE
相关分类