fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> </head> <body> <h1 style="color:red">Hello World</h1> <p id="demo">点击下面的按钮删除上面的标题的样式属性</p> <button onclick="myFunction()">点我</button> <script> function myFunction(){ document.getElementsByTagName("H1")[0].removeAttribute("style"); }; </script> </body> </html>
运行结果