Chapter 5Implementing Interactivity

With all those recipes in your tool belt, you should feel confident in your ability to use htmx to send all kinds of requests to the server and update pages with the responses. The primary focus of htmx is sending HTTP requests to server endpoints in response to events. But not every user interaction requires sending data to the server. Sometimes the logic can remain in the browser.

By implementing client-side logic, you’ll be able to avoid round trips between the browser and the server. This will result in faster interactions and reduced network traffic.

You have many options for implementing client-side interactivity. Consider using interactive HTML elements like details and dialog. Other options include ...

Get Server-Driven Web Apps with htmx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.