实例
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>DOM</title> </head> <body> <script type="text/javascript"> function qc() { var jieguo=""; var arr=["宝马","奔驰","奥迪"] for (var i =0; i<arr.length; i++) { jieguo+= arr[i] + "<br>" } document.getElementById('ce').innerHTML=jieguo; } </script> <button onclick="qc()">选汽车</button> <p id="ce"></p> </body> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例