Body link property
Body objectDefinitions 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:
Return link property:
value | describe |
---|---|
color | Specify the link color.View full CSS color value |
Browser support
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:
<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 . . .
Body object