Skip to content

Commit 0580c2d

Browse files
authored
Update introduction/dynamic-attributes (#7498)
1 parent 970b943 commit 0580c2d

File tree

1 file changed

+2
-4
lines changed
  • site/content/tutorial/01-introduction/03-dynamic-attributes

1 file changed

+2
-4
lines changed

site/content/tutorial/01-introduction/03-dynamic-attributes/text.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: Dynamic attributes
33
---
44

5-
Just like you can use curly braces to control text, you can use them to control element attributes.
5+
You can use curly braces to control element attributes, just like you use them to control text.
66

7-
Our image is missing a `src` — let's add one:
7+
Our image is missing a `src` attribute — let's add one:
88

99
```html
1010
<img src={src}>
@@ -24,12 +24,10 @@ In this case, we're missing the `alt` attribute that describes the image for peo
2424

2525
We can use curly braces *inside* attributes. Try changing it to `"{name} dances."` — remember to declare a `name` variable in the `<script>` block.
2626

27-
2827
## Shorthand attributes
2928

3029
It's not uncommon to have an attribute where the name and value are the same, like `src={src}`. Svelte gives us a convenient shorthand for these cases:
3130

3231
```html
3332
<img {src} alt="A man dances.">
3433
```
35-

0 commit comments

Comments
 (0)