编辑下面的代码:【加编码】
<html> <head> <script> function myFunction() { document.getElementById("demo").innerHTML="我的第一个 JavaScript 函数"; } </script> </head> <body> <h1>我的 Web 页面</h1> <p id="demo">一个段落。</p> <button type="button" onclick="myFunction()">点击这里</button> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂