Body link property

HTML DOM Body link attribute Body object

Definitions and usages

The link property can set or return the link property value of the body element.

The link property specifies the color of the link in the document that was not accessed by clicking.

Grammar

Set the link property:

bodyObject.link=" color "

Return link property:

bodyObject.link

value describe
color Specify the link color.View full CSS color value


Browser support

HTML DOM Body link attribute HTML DOM Body link attribute HTML DOM Body link attribute HTML DOM Body link attribute HTML DOM Body link attribute

Link property is supported by all major browsers


Go back to the link in the document that was not clicked, click on the link, click on the color of the link after the visit:

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

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


HTML DOM Body link attribute Body object