HTML DOM search Property
Definition and Usage
The search property sets or returns the URL from
the question mark (?).
Syntax
location.search=path_from_questionmark
|
Example
Assume that the current URL is: http://w3schools.com/js/tryit.asp?filename=try_loc_search
<html>
<body>
<script type="text/javascript">
document.write(location.search);
</script>
</body>
</html>
|
Output:
Try-It-Yourself Demos
Use the
search property of the location object
|