add alt attributes to images

fixes https://github.com/bigskysoftware/htmx/issues/742
This commit is contained in:
carson 2022-01-17 10:49:49 -07:00
parent e98d817805
commit 53f174d5a4

View File

@ -9,7 +9,7 @@ state that looks like this:
```html
<div hx-get="/graph" hx-trigger="load">
<img class="htmx-indicator" width="150" src="/img/bars.svg"/>
<img alt="Result loading..." class="htmx-indicator" width="150" src="/img/bars.svg"/>
</div>
```
@ -49,13 +49,13 @@ img {
});
onGet("/graph", function(request, params){
return "<img src='/img/tokyo.png'>";
return "<img alt="Tokyo Climate" src='/img/tokyo.png'>";
});
// templates
function lazyTemplate(page) {
return `<div hx-get="/graph" hx-trigger="load">
<img class="htmx-indicator" width="120" src="/img/bars.svg"/>
<img alt="Result loading..." class="htmx-indicator" width="150" src="/img/bars.svg"/>
</div>`;
}
</script>