diff --git a/sites/svelte-5-preview/src/routes/docs/content/01-api/05-imports.md b/sites/svelte-5-preview/src/routes/docs/content/01-api/05-imports.md index a35041d598..94fffca2dd 100644 --- a/sites/svelte-5-preview/src/routes/docs/content/01-api/05-imports.md +++ b/sites/svelte-5-preview/src/routes/docs/content/01-api/05-imports.md @@ -123,6 +123,8 @@ imperatively doing `element.addEventListener`, with that benefit that `attach` w ```js import { attach } from 'svelte/events'; +let element; + attach(element, 'click', () => { console.log('click the element!'); }); @@ -133,6 +135,8 @@ Additionally, `attach` returns a function that easily allows for removal of the ```js import { attach } from 'svelte/events'; +let element; + const remove = attach(element, 'click', () => { console.log('click the element!'); });