Introduction / HTML tags • Svelte Tutorial
Ordinarily, strings are inserted as plain text, meaning that characters like have no special meaning. But sometimes you need to render HTML directly into a component. For example, the words you're reading right now exist in a markdown file that gets included on this page as a blob of HTML. In Svelte, you do this with the special {@html ...} tag: Warning! Svelte doesn't perform any sanitization of the expression inside {@html ...} before it gets inserted into the DOM. This isn't an issue if the content is something you trust like an article you wrote yourself. However if it's some untrusted user content, e.g. a comment on an article, then it's critical that you manually escape it, otherwise you risk exposing your users to Cross-Site Scripting (XSS) attacks. Next: Reactivity
Introduction / HTML tags • Svelte Tutorial Skip to main content Tutorial Packages Playground Blog Basic Svelte Introduction Welcome to Svelte Your first component Dynamic attributes Styling Nested components HTML tags Reactivity State Deep state Derived state Inspecting state Effects Universal reactivity Props Declaring props Default values Spread props Logic If blocks Else blocks Else-if blocks Each blocks Keyed each blocks Await blocks Events DOM events Inline handlers Capturing Component events Spreading events Bindings Text inputs Numeric inputs Checkbox inputs Select bindings Group inputs
Explore this link on the map →related reading
- Svelte tutorial note | sung.codessung.codes
- Overview • Svelte Docssvelte-5-preview.vercel.app
- Configuration • SvelteKit Docssvelte.dev
- Overview • Svelte Docssvelte-5-preview.vercel.app
- Overview • Svelte Docssvelte-5-preview.vercel.app
- Introduction / What is SvelteKit? • Svelte Tutoriallearn.svelte.dev
- Errors and redirects / Basics • Svelte Tutoriallearn.svelte.dev
- Making Sense of React Server Components • Josh W. Comeaujoshwcomeau.com
- Basic Syntax | Markdown Guidemarkdownguide.org
- Introducing runessvelte.dev
- Forms / Validation • Svelte Tutoriallearn.svelte.dev
- ///_hyperscripthyperscript.org