> For the complete documentation index, see [llms.txt](https://bemtv.gitbook.io/bemtvjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bemtv.gitbook.io/bemtvjs/handling-events.md).

# Handling events

The event handlers can be used from the component instance its nomenclature is the same as used in [`addEventListener()`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener), however, they must end with a `$` symbol, the arguments received also follow those of `addEventListener()`:

```javascript
import { _ } from "bemtv";

const { click$, mouseover$, $ } = _`Counter`({ count: 0 });

click$(() => $.count++, { capture: true });

mouseover$(() => console.log("Hey!"));
```

Bemtv will manage and add them to the first element it finds in the template.

To remove just call the returned function:

```javascript
import { _ } from "bemtv";

const { click$ } = _`Hey`();

const removeClickListener = click$(() => {});

removeClickListener();
```
