Skip to main content
Version: 3.45.0

URLSearchParams.set()

The set() method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it.

Syntax​

set(name, value)

Parameters​

  • name
    • : The name of the parameter to set.
  • value
    • : The value of the parameter to set.

Return value​

None undefined.