Easy Tutorial
❮ Prop Tablerow Ch Prop Track Readystate ❯

Body aLink Attribute


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 document link when clicked (when the link is activated).

Syntax

Setting the aLink attribute:

Returning the aLink attribute:

Value Description
color Specifies the link color. See the full CSS Color Values

Browser Support

All major browsers support the aLink attribute.


Example

Return the color value of the link after it has been clicked:

<p><a href="//www.tutorialprob.com">tutorialpro.org</a></p>
<p><a href="//www.tutorialprob.com/html/">HTML Tutorial</a></p>
<script>
document.write("The color of the unclicked link is: ")
document.write(document.getElementById("tutorialpro").link);
document.write("<br>The color of the selected link is: ")
document.write(document.getElementById("tutorialpro").aLink);
document.write("<br>The color of the visited link is: ")
document.write(document.getElementById("tutorialpro").vLink);
</script>

❮ Prop Tablerow Ch Prop Track Readystate ❯