You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 5, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: content/tutorial/01-svelte/01-introduction/03-dynamic-attributes/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ When building web apps, it's important to make sure that they're _accessible_ to
19
19
In this case, we're missing the `alt` attribute that describes the image for people using screenreaders, or people with slow or flaky internet connections that can't download the image. Let's add one:
20
20
21
21
```svelte
22
-
<img src={src} +++alt="A man dances."+++>
22
+
<img src={src} +++alt="A man dances."+++ />
23
23
```
24
24
25
25
We can use curly braces _inside_ attributes. Try changing it to `"{name} dances."` — remember to declare a `name` variable in the `<script>` block.
@@ -29,5 +29,5 @@ We can use curly braces _inside_ attributes. Try changing it to `"{name} dances.
29
29
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:
0 commit comments