August 2024
Intermediate to advanced
186 pages
4h 3m
English
It’s common for htmx endpoints to return a single HTML element. The one element can have many child elements, but it’s still a single element.
As we’ve seen, the returned element will be swapped into the DOM at a location specified by the hx-target attribute. Exactly how it will be swapped is specified by the hx-swap attribute.
Sometimes it’s desirable to update multiple parts of the current page. Consider the following todo app whose code can be found at todo-hono.[25]

When a new todo is added, we want to display it in the list. But we also want to update the status line that currently reads “1 of 2 remaining.”
You can achieve ...
Read now
Unlock full access