W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h3>如何访问 HEADER 元素的演示</h3> <article> <header id="myHeader"> <h3>Internet Explorer 9</h3> </header> <p>Windows Internet Explorer 9 (abbreviated as IE9) was released to the public on March 14, 2011 at 21:00 PDT.....</p> </article> <p>单击按钮将标题元素的颜色设置为红色。</p> <button onclick="myFunction()">试一试</button> <script> function myFunction() { var x = document.getElementById("myHeader"); x.style.color = "red"; } </script> </body> </html>