Body aLink 屬性

定義和用法
aLink 屬性可設置或者返回 body 元素中 alink 屬性的值。
alink 屬性指定了文檔鏈接點擊時的顏色 (鏈接被點擊時)。
語法
設置 aLink 屬性:
bodyObject.aLink="color"
返回 aLink 屬性:
bodyObject.aLink
值 | 描述 |
---|---|
color | 指定了鏈接顏色。查看完整的 CSS 顏色值 |
瀏覽器支持
所有主要瀏覽器都支持 aLink 屬性
實例
實例
返回頁面鏈接,鏈接點擊時,鏈接點擊后的顏色值:
<html>
<body id="w3s" link="blue" alink="green" vlink="red">
<p><a href="http://www.w3cschool.cn">W3CSchool.cn</a></p>
<p><a href="http://www.vxbq.cn/s/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.cn">W3CSchool.cn</a></p>
<p><a href="http://www.vxbq.cn/s/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>
嘗試一下 ?
