Body aLink property
Body objectDefinitions and usages
The aLink property can set or return the value of the alink property in the body element.
The alink property specifies the color of the document link when it is clicked (when the link is clicked).
Grammar
Set the aLink property:
Returns the aLink property:
value | describe |
---|---|
color | Specifies the link color.View full CSS color value |
Browser support
The aLink property is supported by all major browsers
Back to the page link, when the link clicks, the color value of the link clicks:
<body id="w3s" link="blue" alink="green" vlink="red">
<p><a href="http://www.w3cschool.cn">W3CSchool.cn</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