编辑下面的代码:【加编码】
<html> <body id="w3s" link="blue" alink="green" vlink="#FF0000"> <p><a href="/">ziqiangxuetang.com</a></p> <p><a href="/html/">HTML Tutorial</a></p> <script> document.write("Link color is: ") document.write(document.getElementById("w3s").link); document.write("<br>Active link color is: ") document.write(document.getElementById("w3s").aLink); document.write("<br>Visited link color is: ") document.write(document.getElementById("w3s").vLink); </script> <p><b>Note:</b> Internet Explorer always returns the colors in hex, while most other browsers returns the attribute value.</p> <p><b>Note:</b> If using color names, different browsers may render different colors, and Firefox have problems if the attribute value is in RGB code (will not display correct color).</p> <p><b>Tip:</b> To produce equal results in all browsers, always use hex code to specify colors.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂