HTML DOM 바디 연결 특성
정의 및 사용
속성 세트를 링크하거나 링크 본문 요소의 속성 값을 반환합니다.
링크 속성은 문서를 지정하지 않은 방문한 링크의 색상을 클릭합니다.
문법
설정 링크 속성 :
bodyObject.link="color"
돌아 가기 링크 속성 :
bodyObject.link
值 | 描述 |
---|---|
color | 指定链接颜色。查看完整的 CSS 颜色值 |
브라우저 지원
모든 주요 브라우저는 링크 속성을 지원
예
예
문서, 링크를 클릭 링크를 클릭, 뒷면 색상에 액세스하려면 링크를 클릭하지 반환
<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>
»시도
바디 개체