0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-30 00:46:29 +01:00
svelte/documentation/tutorial/05-events/02-inline-handlers/text.md
Paul "Joey" Clark 58e95c6aca
docs: Remove old redundant text (#8893)
The quote marks were already removed in db2d07f236
2023-07-03 22:31:20 +02:00

445 B

title
Inline handlers

You can also declare event handlers inline:

<div on:mousemove={(e) => (m = { x: e.clientX, y: e.clientY })}>
	The mouse position is {m.x} x {m.y}
</div>

In some frameworks you may see recommendations to avoid inline event handlers for performance reasons, particularly inside loops. That advice doesn't apply to Svelte — the compiler will always do the right thing, whichever form you choose.