THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

Area search Property

Area Object Reference Area Object

Example

Return the querystring of the URL for a specific area in an image-map:

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

The result of x will be:

?id=searchtest
Try it yourself »

Definition and Usage

The search property sets or returns the querystring part of the href attribute value.

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

The querystring is the part of the URL after the question mark (?). This is often used for parameter passing.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The search property is supported in all major browsers.


Syntax

Return the search property:

areaObject.search

Set the search property:

areaObject.search=querystring

Property Values

Value Description
querystring Specifies the search part of a URL

Technical Details

Return Value: A String, representing the querystring part of the URL, including the question mark (?)

More Examples

Example

Change the query string of the URL for a specific area in an image-map:

document.getElementById("venus").search = "somenewsearchvalue";
Try it yourself »

Related Pages

JavaScript reference: location.search Property


Area Object Reference Area Object