Area searchプロパティ
Area オブジェクト
定義と用法
search プロパティは、href 属性値のクエリ文字列部分を設定または返します。
構文
areaObject.search=querystring
ブラウザサポート
![]()
![]()
![]()
![]()
![]()
すべての主要ブラウザは search プロパティをサポートしています。
例
例
以下の例は、"Venus" の link-URL のクエリ文字列部分を返します:/p>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>サンプル(example.com)</title>
</head>
<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">
</map>
<p>金星エリアのクエリ文字列部分:
<script>
document.write(document.getElementById('venus').search);
</script>
</p>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<title>サンプル(example.com)</title>
</head>
<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">
</map>
<p>金星エリアのクエリ文字列部分:
<script>
document.write(document.getElementById('venus').search);
</script>
</p>
</body>
</html>
上記の例の出力結果:
金星エリアのクエリ文字列部分: ?id=venus
試してみる »
Area オブジェクト その他の拡張機能