---
name: "up.off"
area: "API"
kind: "JavaScript function"
parent: "up.event module"
url: "https://unpoly.com/api/up.off"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.event module](https://unpoly.com/api/up.event.md)</nav>

# up.off([element], types, listener)

Unbinds an event listener previously bound with [`up.on()`](https://unpoly.com/api/up.on.md).

## Example {#example}

Let's say you are listening to clicks on `.button` elements:

```js
let listener = function() { ... }
up.on('click', '.button', listener)
```

You can stop listening to these events like this:

```js
up.off('click', '.button', listener)
```

---

## Parameters {#parameters}

### Observed events {#parameters-observed-events}

#### [element=document] {#element}

(optional)

The element from which to unbind the listener.

Type: [Element](https://developer.mozilla.org/en-US/docs/Web/API/Element) | [jQuery](https://learn.jquery.com/using-jquery-core/jquery-object/)

#### types {#types}

(required)

The event types to unbind.

Multiple event types may be passed as either a space-separated string (`'foo bar'`), a comma-separated string (`'foo, bar'`) or as an array of types (`['foo', 'bar']`).

Type: string | [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)<string>

### Listener {#parameters-listener}

#### listener {#listener}

(required)

The listener function to unbind.

You must pass a reference to the same function reference that was used to register the listener.

Type: Function(event, [element], [[data](https://unpoly.com/learn/data.md)])

