Body aLink property

HTML DOM Body aLink attribute Body object

Definitions 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:

bodyObject.aLink=" color "

Returns the aLink property:

bodyObject.aLink

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


Browser support

HTML DOM Body aLink attribute HTML DOM Body aLink attribute HTML DOM Body aLink attribute HTML DOM Body aLink attribute HTML DOM Body aLink attribute

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:

<html>
<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 . . .


HTML DOM Body aLink attribute Body object