VOOZH about

URL: https://www.geeksforgeeks.org/html/html-dom-url-searchparams-property/

⇱ HTML DOM URL searchParams property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML DOM URL searchParams property

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.

Syntax:

params = url.searchParams;

Return Value: A URLSearchParams object.

Example: In this example, we will get the searchParams of the URL, here URL is "https://gfg.com/?name=Taran" taken for example.

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

Output:

Before Button Click:

👁 Image

After Button Click:

👁 Image

Supported Browsers:

  • Google Chrome
  • Edge
  • Firefox
  • Safari
  • Opera
Comment
Article Tags:
Article Tags: