---
hide_title: false
hide_table_of_contents: false
pagination_next: null
pagination_prev: null
---
# 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

```js
set(name, value)
```

### Parameters

- `name`
  - : The name of the parameter to set.
- `value`
  - : The value of the parameter to set.

### Return value

None `undefined`.
