JavaScript Know the value of GET parameters from URL Last Updated : 15 Dec, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we will see how to get the GET parameters from a URL using JavaScript. In order to know the parameters that are passed by the "GET" method, sometimes we need to pass the Email and other details. For that purpose, we are using the following snippet of code. Example 1: This example get the value of "a" parameter from the URL. JavaScript function GET_Paramters() { const url = "https://ide.geeksforgeeks.org/login.php?a=GeeksforGeeks&b=100&c=Computer Science portal for Geeks"; let urlObject = new URL(url); let get_params = urlObject.searchParams.get("a"); console.log(get_params); } GET_Paramters(); OutputGeeksforGeeks Example 2:This example returns the value of all the parameters from the URL. JavaScript function GET_Paramters() { const url = "https://ide.geeksforgeeks.org/login.php?a=GeeksforGeeks&b=100&c=Computer Science portal for Geeks"; let urlObject = new URL(url); let a = urlObject.searchParams.get("a"); let b = urlObject.searchParams.get("b"); let c = urlObject.searchParams.get("c"); console.log(a); console.log(b); console.log(c); } GET_Paramters(); OutputGeeksforGeeks 100 Computer Science portal for Geeks Comment More infoAdvertise with us Next Article How to get an object containing parameters of current URL in JavaScript ? P PranchalKatiyar Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Questions Similar Reads How to retrieve GET parameters from JavaScript ? In order to know the parameters, those are passed by the âGETâ method, like sometimes we pass the Email-id, Password, and other details. For that purpose, We are using the following snippet of code. When you visit any website, ever thought about what the question mark '?' is doing in the address bar 2 min read How to get URL Parameters using JavaScript ? To get URL parameters using JavaScript means extracting the query string values from a URL. URL parameters, found after the ? in a URL, pass data like search terms or user information. JavaScript can parse these parameters, allowing you to programmatically access or manipulate their values.For getti 3 min read How to add a parameter to the URL in JavaScript ? Given a URL the task is to add parameter (name & value) to the URL using JavaScript. URL.searchParams: This read-only property of the URL interface returns a URLSearchParams object providing access to the GET-decoded query arguments in the URL. Table of Content Using the append methodUsing set m 2 min read How to get an object containing parameters of current URL in JavaScript ? The purpose of this article is to get an object which contains the parameter of the current URL. Example: Input: www.geeksforgeeks.org/search?name=john&age=27 Output: { name: "john", age: 27 } Input: geeksforgeeks.org Output: {} To achieve this, we follow the following steps. Create an empty obj 2 min read How To Get URL And URL Parts In JavaScript? In web development, working with URLs is a common task. Whether we need to extract parts of a URL or manipulate the URL for navigation, JavaScript provides multiple approaches to access and modify URL parts. we will explore different approaches to retrieve the full URL and its various components.The 3 min read How To Get The URL Parameters Using AngularJS? In AngularJS, retrieving URL parameters is essential for managing dynamic content and user interactions based on the URL state. In this article, we'll learn various approaches to achieve this.Table of ContentApproach 1: Using ActivatedRoute ServiceApproach 2: Using Router ServiceApproach 3: Using UR 3 min read Like