0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-29 16:36:44 +01:00

docs: describe that bind:value creates a two-way binding (#8311)

---------

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
This commit is contained in:
Mike Randazzo 2023-02-23 04:46:08 -08:00 committed by GitHub
parent 835362af88
commit 487fedce6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,7 @@
---
title: Textarea inputs
---
The `<textarea>` element behaves similarly to a text input in Svelte — use `bind:value`:
The `<textarea>` element behaves similarly to a text input in Svelte — use `bind:value` to create a two-way binding between the `<textarea>` content and the `value` variable:
```html
<textarea bind:value={value}></textarea>
@ -14,4 +13,4 @@ In cases like these, where the names match, we can also use a shorthand form:
<textarea bind:value></textarea>
```
This applies to all bindings, not just textareas.
This applies to all bindings, not just textareas.