HTML DOM Area search property
Definition and Usage
search property sets or returns the query string part of the href attribute value.
grammar
areaObject.search=querystring
Browser Support
All major browsers support attribute search
Examples
Examples
The following example returns "Venus" in the query string part of the link-URL: / p>
<!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?id=venus">
</map>
<p>金星区域的查询字符串部分:
<script>
document.write(document.getElementById('venus').search);
</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?id=venus">
</map>
<p>金星区域的查询字符串部分:
<script>
document.write(document.getElementById('venus').search);
</script>
</p>
</body>
</html>
Examples of the above output:
金星区域的查询字符串部分: ?id=venus
try it"
Area objects