fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <h1 id="myH1">如何改变标题的样式</h1> <p>点击按钮改变 H1 元素的样式。</p> <button onclick="myFunction()">尝试一下</button> <script> function myFunction(){ document.getElementById("myH1").style.color = "red"; }; </script> </body> </html>
运行结果