3000 explained code solutions for 75 technologies


javascriptGet URL query string values by parameter name


var value = (new URLSearchParams(window.location.search)).get('param');ctrl + c
var value

this variable will contain value of specified query param

new URLSearchParams

creates object that parses query string

window.location.search

query string part of current url

get('param')

get value for query string parameter named param