search
Summary
Sets or retrieves the substring of the href property that follows the question mark.
Property of dom/Locationdom/Location
Syntax
var queryString = location.search;
location.search = queryString;
Return Value
Returns an object of type StringString
The query string component of the URL.
Examples
This example function returns the search property of the current page location.
function getSearch() {
return document.location.search;
}
Notes
The substring that follows the question mark is the query string or form data.
Attributions
Microsoft Developer Network: [Windows Internet Explorer API reference Article]