Latest web development tutorials

HTML DOM Body link attribute

Body Object Reference Body Object

Definition and Usage

link property sets or returns the property value of the link body element.

link attribute specifies the document, click on the color of visited links are not.

grammar

Set link properties:

bodyObject.link="color"

Back link attributes:

bodyObject.link

描述
color 指定链接颜色。查看完整的 CSS 颜色值


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support link attribute


Examples

Examples

Returns documents not click on the link, click on the link, click on the link to access the rear color:

<html>
<body id="w3s" link="blue" alink="green" vlink="red">

<p><a href="http://www.w3cschool.cc">W3CSchool.cc</a></p>
<p><a href="http://www.w3cschool.cc/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>

</body>
</html>

try it"


Body Object Reference Body Object