File tree Expand file tree Collapse file tree
src/routes/reference/jsx-attributes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,12 +24,14 @@ description: >-
2424
2525- ** Type:** ` string `
2626
27- HTML string parsed into the element.
27+ HTML string inserted as raw markup into the element.
2828
2929## Behavior
3030
3131- Setting ` innerHTML ` replaces the element's existing children with nodes parsed from the string.
3232- The value is written through the DOM ` innerHTML ` property.
33+ - In SSR output, the HTML string is emitted as child content without escaping.
34+ - Unlike [ ` textContent ` ] ( /reference/jsx-attributes/textcontent ) , ` innerHTML ` parses markup instead of inserting plain text.
3335
3436:::caution
3537Using ` innerHTML ` with unsanitized user-supplied data can introduce security vulnerabilities.
@@ -40,7 +42,7 @@ Using `innerHTML` with unsanitized user-supplied data can introduce security vul
4042### Basic usage
4143
4244``` tsx
43- <div innerHTML = { markup } />
45+ <div innerHTML = { " <strong>Hello</strong> " } />
4446```
4547
4648## Related
You can’t perform that action at this time.
0 commit comments