<!DOCTYPE html> <html> <body> <h2>外部 JavaScript</h2> <p id="demo">一个段落。</p> <button type="button" onclick="myFunction()">试一试</button> <p>(myFunction 存储在名为 "myScript.js" 的外部文件中。)</p> <script src="/static/demo/html/js/myScript.js"></script> </body> </html>