后浪云JAVA script和HTML DOM参考手册:HTML DOM Body aLink 属性
Body 对象
定义和用法
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.IDC.NET">W3CSchool.cn</a></p>
<p><a href="//www.IDC.NET/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 对象
版权声明:
作者:后浪云
链接:https://www.idc.net/help/188387/
文章版权归作者所有,未经允许请勿转载。
THE END