Events

As we've briefly seen already, you can listen to any event on an element with the on: directive:

<div on:mousemove={handleMousemove}>
	The mouse position is {m.x} x {m.y}
</div>


			
loading editor...

Console

loading Svelte compiler...


			
loading editor...

Compiler options

result = svelte.compile(source, {
generate:
});


			
loading editor...