编辑下面的代码:【加编码】
<html> <head> <style> div {color: red; } </style> </head> <body> <div> <h1 id="bc">Hello World</h1> <ul> <li id="a">Item one</li> <li id="b">Item two</li> <li id="c">Item three</li> </ul> </div> <p>点击“尝试一下”按钮把第二个列表项的 color 属性的值设置为 "initial":</p> <button onclick="myFunction()">尝试一下</button> <script> function myFunction() { document.getElementById("b").style.color = "initial"; } </script> <p><b>注意:</b>Internet Explorer 或 Opera 15 及其之前的版本不支持 initial 关键字作为一个属性值。</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂