updated select-bindings text.md (#6333)

Referenced line is now 20 instead of 24
pull/6339/head
Lawrence Logoh 3 years ago committed by GitHub
parent 19e4a4fdf3
commit 58b897fc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2,7 +2,7 @@
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 = ''}">
@ -10,4 +10,4 @@ We can also use `bind:value` with `<select>` elements. Update line 24:
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.

Loading…
Cancel
Save