HTML DOM 지역 href 속성
정의 및 사용
HREF 속성 집합 또는 지역의 HREF 속성의 g의 값을 반환합니다.
href 속성은 타겟 영역에 대한 링크를 지정한다.
문법
areaObject.href=URL
브라우저 지원
모든 주요 브라우저는 href 속성을 지원
예
예
다음 예제는 이미지 맵 "비너스"영역의 href 속성을 반환합니다 :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
<p>金星的href属性值:
<script>
document.write(document.getElementById("venus").href);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>本教程(w3big.com)</title>
</head>
<body>
<img src="planets.gif" width="145" height="126" usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle" coords="124,58,8" alt="Venus" href="venus.htm">
</map>
<p>金星的href属性值:
<script>
document.write(document.getElementById("venus").href);
</script>
</p>
</body>
</html>
위의 출력의 예 :
금성 href 속성 값 : http://www.w3big.com/try/demo_source/venus.htm
»시도
지역 객체