search property
Sets or retrieves the substring of the href property that follows the question mark.
Syntax
| JavaScript | |
|---|
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
Show: