HTML DOM Body aLink property
Definition and Usage
aLink property sets or returns the value of the body element alink property.
alink attribute specifies the color of the document link when clicked (the link is clicked).
grammar
Setting aLink properties:
bodyObject.aLink="color"
Back aLink properties:
bodyObject.aLink
值 | 描述 |
---|---|
color | 指定了链接颜色。查看完整的 CSS 颜色值 |
Browser Support
All major browsers support aLink property
Examples
Examples
Back page links, links clicked, clicked the link color values:
<html>
<body id="w3s" link="blue" alink="green" vlink="red">
<p><a href="http://www.w3cschool.cc">W3CSchool.cc</a></p>
<p><a href="http://www.w3cschool.cc/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>
<body id="w3s" link="blue" alink="green" vlink="red">
<p><a href="http://www.w3cschool.cc">W3CSchool.cc</a></p>
<p><a href="http://www.w3cschool.cc/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"
Body Object