Skip to content
Related Articles

Related Articles

HTML DOM URL searchParams property

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 14 Jul, 2020

The searchParams property returns a URLSearchParams object allowing access to the GET all the decoded query arguments contained in the URL.


params = url.searchParams;

Return Value: A URLSearchParams object.

Example: In this example, we will get the searchParams of the URL, here URL is “” taken for example.

In this URL we will get the name parameter using this property.

<!doctype html>
    <meta charset="utf-8">
<title>HTML DOM URL searchParams property</title>    
    <p>Click Here To Get searchparams</p>
    <button onclick="Check()">Click Here</button>
    <div class="child"></div>
    function Check(){
         let params = (new URL(
      "Name parameter from URL is :", params.get("name"));


Before Button Click:

After Button Click:

Supported Browsers:

  • Google Chrome
  • Edge
  • Firefox
  • Safari
  • Opera

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!