W3CAPI 实例工具箱
运行代码
源代码
<!DOCTYPE html> <head> <meta charset="utf-8" /> <title>js 示例</title> </head> <body> <script type="text/javascript"> var value = new Array('$.1', '$.2', '$.3'); var fruits = new Array("Orange", "Apple", "Banana", "Chery",value); var newParagraph = document.createElement("p"); //creates a new paragraph element var newText = document.createTextNode(fruits.valueOf()); //creates text along with ouput to be displayed newParagraph.appendChild(newText); //created text is appended to the paragraph element created document.body.appendChild(newParagraph); // created paragraph and text along with output is appended to the document body </script> </body> </html>
运行结果
友情提示
您正在使用的浏览器为IE浏览器,或者使用了IE模式
如果你使用的是IE浏览器,建议您下载
360急速浏览器
/
火狐浏览器
/
Opera浏览器