Skip to content

Commit 820490f

Browse files
committed
add a tutorial chapter
1 parent abcdc74 commit 820490f

File tree

20 files changed

+45
-0
lines changed

20 files changed

+45
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<script>
2+
let html = '<p>Write some text!</p>';
3+
</script>
4+
5+
<div contenteditable="true"></div>
6+
7+
<pre>{html}</pre>
8+
9+
<style>
10+
[contenteditable] {
11+
padding: 0.5em;
12+
border: 1px solid #eee;
13+
border-radius: 4px;
14+
}
15+
</style>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script>
2+
let html = '<p>Write some text!</p>';
3+
</script>
4+
5+
<div
6+
contenteditable="true"
7+
bind:innerHTML={html}
8+
></div>
9+
10+
<pre>{html}</pre>
11+
12+
<style>
13+
[contenteditable] {
14+
padding: 0.5em;
15+
border: 1px solid #eee;
16+
border-radius: 4px;
17+
}
18+
</style>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Contenteditable bindings
3+
---
4+
5+
Elements with a `contenteditable="true"` attribute support `textContent` and `innerHTML` bindings:
6+
7+
```html
8+
<div
9+
contenteditable="true"
10+
bind:innerHTML={html}
11+
></div>
12+
```

0 commit comments

Comments
 (0)