How to get query parameters values from a URL in JavaScript

1 Answer

0 votes
const URLParams= "?client=firefox-b-e&biw=236";

const params = new URLSearchParams(URLParams)

const client = params.get("client");
const biw = params.get("biw");

console.log(client);
console.log(biw);
  


    
/*
run:
    
"firefox-b-e"
"236"
    
*/

 



answered Feb 24, 2021 by avibootz

Related questions

1 answer 242 views
3 answers 258 views
1 answer 121 views
2 answers 163 views
1 answer 167 views
167 views asked Aug 7, 2020 by avibootz
1 answer 117 views
...