const queryString = window.location.href; const parameters = new URLSearchParams(queryString); const value = parameters.get('key');