0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00
svelte/documentation/tutorial/05-events/01-dom-events/text.md

12 lines
222 B
Markdown
Raw Normal View History

2019-03-10 14:30:29 +01:00
---
title: DOM events
---
As we've briefly seen already, you can listen to any event on an element with the `on:` directive:
```svelte
2019-03-10 14:30:29 +01:00
<div on:mousemove={handleMousemove}>
The mouse position is {m.x} x {m.y}
</div>
```