Skip to content

Commit

Permalink
updated select-bindings text.md (#6333)
Browse files Browse the repository at this point in the history
Referenced line is now 20 instead of 24
  • Loading branch information
lawrencelogoh authored May 16, 2021
1 parent 19e4a4f commit 58b897f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/content/tutorial/06-bindings/06-select-bindings/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
title: Select bindings
---

We can also use `bind:value` with `<select>` elements. Update line 24:
We can also use `bind:value` with `<select>` elements. Update line 20:

```html
<select bind:value={selected} on:change="{() => answer = ''}">
```

Note that the `<option>` values are objects rather than strings. Svelte doesn't mind.

> Because we haven't set an initial value of `selected`, the binding will set it to the default value (the first in the list) automatically. Be careful though — until the binding is initialised, `selected` remains undefined, so we can't blindly reference e.g. `selected.id` in the template.
> Because we haven't set an initial value of `selected`, the binding will set it to the default value (the first in the list) automatically. Be careful though — until the binding is initialised, `selected` remains undefined, so we can't blindly reference e.g. `selected.id` in the template.

0 comments on commit 58b897f

Please sign in to comment.