Return the querystring part of a link:
The result of x will be:
The search property sets or returns the querystring part of the href attribute value.
The querystring is the part of the URL after the question mark (?). This is often used for parameter passing.
The search property is supported in all major browsers.
Return the search property:
Set the search property:
Value | Description |
---|---|
querystring | Specifies the search part of a URL |
Return Value: | A String, representing the querystring part of the URL, including the question mark (?) |
---|
Change the querystring part of a link:
JavaScript reference: location.search Property