安科网
源代码:
点击运行
<!DOCTYPE html> <html> <body> <h1>My First JavaScript</h1> <p id="demo"> JavaScript can react to events. Like the click of a button. </p> <script> function myFunction() { document.getElementById("demo").innerHTML="Hello JavaScript!"; } </script> <button type="button" onclick="myFunction()">Click Me!</button> </body> </html>
运行结果
Copyright © 2013 - 2019 Ancii.com All Rights Reserved
京ICP备18063983号-5
京公网安备11010802014868号