Location search Property
Location object
Definition and Usage
The search property is a readable and writable string that sets or returns the query part of the current URL (the part after the question mark ?).
Syntax
location.search
Browser support





All major browsers support the search property.
Example
Example
Return the query part of the URL. Assume the current URL is http://www.runoob.com/submit.htm?email=someone@ example.com:
The output of the above example is:
?email=someone@example.com
Location object