Body aLinkProperty
Body Object
Definition and Usage
The aLink property sets or returns the value of the alink attribute in the body element.
The alink attribute specifies the color of the link in the document when it is clicked (when the link is clicked).
Syntax
Set the aLink property:
bodyObject.aLink="color"
Return the aLink property:
bodyObject.aLink
| Value | Description |
|---|---|
| color | Specifies the link color. See the fullCSS color values |
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the aLink property
Example
Example
Return the color value of the page link, and the color value after the link is clicked:
<p><a href="//www.exampleb.com">Example</a></p>
<p><a href="//www.exampleb.com/html/">HTML Tutorial</a></p>
<script>document.write("The unvisited link color is: ")
document.write(document.getElementById("example").link);
document.write("<br>The active link color is: ")
document.write(document.getElementById("example").aLink);
document.write("<br>The visited link color is: ")
document.write(document.getElementById("example").vLink);</script>
Try it Yourself »
Body Object Other Extensions