HTML DOM Body vLink 屬性
定義和用法
vLink 屬性可設置或者返回body 元素中vlink屬性值。
vlink 屬性描述了點擊過的鏈接文本顏色。
語法
設置vLink 屬性:
bodyObject.vLink="color"
返回vLink 屬性:
bodyObject.vLink
值 | 描述 |
---|---|
color | 指定链接颜色。查看完整的 CSS 颜色值 |
瀏覽器支持
所有主要瀏覽器都支持vLink 屬性
實例
實例
返回頁面鏈接點擊及點擊後文本的顏色值:
<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>
嘗試一下»
Body對象