Svelte
<svelte:document>
svelte:document
<svelte:document onevent={handler} />
<svelte:document bind:prop={value} />
Similarly to <svelte:window>, this element allows you to add listeners to events on document, such as visibilitychange, which don't fire on window. It also lets you use attachments on document.
As with <svelte:window>, this element may only appear the top level of your component and must never be inside a block or element.
<svelte:document onvisibilitychange={handleVisibilityChange} {@attach someAttachment} />
You can also bind to the following properties:
activeElementfullscreenElementpointerLockElementvisibilityState
All are readonly.