Area searchProperty

Area 对象参考手册Area Object

Definition and Usage

The search property sets or returns the query string portion of the href attribute value.

Syntax

areaObject.search=querystring


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the search property


Example

Example

The following example returns the query string portion of the link-URL for "Venus":</p>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Example Tutorial (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>The query string portion of the Venus area:
<script>
document.write(document.getElementById('venus').search);
</script>
</p>

</body>
</html>

The output of the above example is:

The query string portion of the Venus area: ?id=venus

Try it Yourself »



Area 对象参考手册Area Object Other extensions