W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h2>JavaScript 语句</h2> <p>JavaScript 代码块在 { 与 } 之间编写。</p> <button type="button" onclick="myFunction()">点击我!</button> <p id="demo1"></p> <p id="demo2"></p> <script> function myFunction() { document.getElementById("demo1").innerHTML = "Hello Kitty."; document.getElementById("demo2").innerHTML = "How are you?"; } </script> </body> </html>