document.linkColor
Deprecated
Avoid using this feature in new projects. Document color attributes are superseded by CSS. This feature may be a candidate for removal from web standards or browsers.>
Consider using the following features instead: background-color、Color、CSS object model或getComputedStyle().>
概述
linkColor 用来获取和设置文档内链接元素 (<a>) 的颜色。
语法
color = document.linkColor document.linkColor = color
参数
color是一个代表颜色的字符串 (比如"red","blue"等),或者是一个 16 进制 rgb 颜色值 (比如"#ff0000").
备注
在 Mozilla Firefox 中,该属性的默认值是 blue(或者说是#0000ee ).
document.linkColor在 DOM Level 2 HTML 中已被废弃.
替代方案是在链接元素上 HTML anchor (<a>) 使用 css color 属性,(比如a {color:red;}) 或者 :link 伪类 ,(比如:link {color:red;}).
另一种方法是使用 document.body.link, 该属也在HTML 4.01中被废弃。
例子
document.linkColor = "blue";