Area search attribute

Definition and usage

search Attribute sets or returns href attribute value The query string part.

href The attribute specifies the destination of the link in the area.

The query string is the part after the question mark (?) in the URL, usually used for parameter transmission.

See also:

JavaScript Reference Manual:location.search attribute

Example

Example 1

Return the URL query string of the specific area in the image map:

var x = document.getElementById("venus").search;

Try it yourself

Example 2

Change the URL query string of the specific area in the image map:

document.getElementById("venus").search = "somenewsearchvalue";

Try it yourself

Syntax

Return the search attribute:

areaObject.search

Set the search attribute:

areaObject.search = querystring

Attribute Value

Value Description
querystring Specifies the search part of the URL.

Technical Details

Return Value: A string value representing the query string part of the URL, including the question mark (?).

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support