Area noHrefプロパティ
Area オブジェクト
定義と使い方
noHref プロパティは、領域の nohref 属性値を設定または返します。
nohref 属性は、領域に関連リンクがないことを指定します。
ヒント:nohref 属性は、ブラウザにハイパーリンク属性が存在しないことを通知します。また、href 属性を使用せずに、関連リンクがないことをより簡単に設定することもできます。
構文
areaObject.noHref=true|false
ブラウザサポート
![]()
![]()
![]()
![]()
![]()
IE ブラウザを除き、すべての主要ブラウザが noHref プロパティをサポートしています。
例
例
次の例では、イメージマップ内の "Venus" 領域の "noHref" プロパティを返します。
<html>
<body>
<img src="planets.gif.html"
width="145" height="126"
usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle"
coords="124,58,8"
alt="Venus"
href="venus.htm.html"
nohref="nohref.html">
</map>
<p>Value of nohref attribute for the "Venus" area is:
<script>
document.write(document.getElementById("venus").noHref);
</script>
</p>
</body>
</html>
<body>
<img src="planets.gif.html"
width="145" height="126"
usemap="#planetmap">
<map name="planetmap">
<area id="venus" shape="circle"
coords="124,58,8"
alt="Venus"
href="venus.htm.html"
nohref="nohref.html">
</map>
<p>Value of nohref attribute for the "Venus" area is:
<script>
document.write(document.getElementById("venus").noHref);
</script>
</p>
</body>
</html>
上記の例の出力結果:
Value of nohref attribute for the "Venus" area is: true
試してみる »
Area オブジェクト その他の拡張