Body aLink attribute
Body object
Definition and Usage
The aLink attribute sets or returns the value of the alink attribute in the body element.
The alink attribute specifies the color of the link when clicked (when the link is clicked).
Syntax
Set the aLink attribute:
bodyObject.aLink="
color
"
Return the aLink attribute:
bodyObject.aLink
| Value | Description |
|---|---|
| color | Specifies the link color. See the complete A CSS color value |
Browser support





All major browsers support the aLink attribute
Example
Example
Return the page links and the color value of the links when clicked and after being clicked:
<p>
<a href="//www.runoobb.com">Runoob Tutorial
a
p
<p>
<a href="//www.runoobb.com/html/">HTML Tutorial
a
p
<
script
document.write("color of unclicked link is: ") document.write(document.getElementById("runoob").link); document.write("
<
br
selected link color is: ") document.write(document.getElementById("runoob").aLink); document.write("
<
br
visited link color is: ") document.write(document.getElementById("runoob").vLink);
script
Try it »
Body object