Edit The Code:
See Result »
Try it Yourself - ©
w3big.com
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>本教程(w3big.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>