Window location.search attribute
- Previous Page replace()
- Next Page assign()
- Go Up One Level Window Location
Definition and usage
search
The attribute returns the query string part of the URL, including the question mark (?).
search
The attribute can also be used to set the query string.
Comment
The query string part is the part after the question mark (?) in the URL.
Query strings are used to pass parameters.
Syntax
Return search attribute:
location.search
Set search attribute:
location.search = querystring
Attribute value
Value | Description |
---|---|
querystring | The query string part of the URL. |
Return value
Type | Description |
---|---|
String | The query string part of the URL, including the question mark (?). |
Browser Support
All Browsers Support location.search
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous Page replace()
- Next Page assign()
- Go Up One Level Window Location