编程教程 - 技术改变世界
编程教程提供了 JS 在线测试工具,可在线测试 JavaScript 代码,你可以在代码编辑器中输入 JavaScript 代码并点击运行查看结果。
源代码
点击运行
<!DOCTYPE html> <html> <body> <h2>外部 JavaScript</h2> <p id="demo">一个段落。</p> <button type="button" onclick="myFunction()">试一试</button> <p>(myFunction 存储在名为 "myScript.js" 的外部文件中。)</p> <script src="/demo/myScript.js"></script> </body> </html>
运行结果