Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

search property

Sets or retrieves the substring of the href property that follows the question mark.

Syntax

JavaScript

p = object.search

 

Property values

Type: String

the substring of the href property representing the query string (including the question mark).

Remarks

The substring that follows the question mark is called the query string. It represents information passed to the webpage or hosting server.

Note that the value of the searchproperty includes the question mark as the first character.

Examples

This example function returns the search property of the current page location.


function getSearch()
{
    return document.location.search;
}

See also

a
area
location

 

 

Show:
© 2016 Microsoft