Skip to content

Commit 0ef73e8

Browse files
committed
update
1 parent d0217b0 commit 0ef73e8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/routes/reference/jsx-attributes/innerhtml.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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
3537
Using `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

0 commit comments

Comments
 (0)