Learning path

Full curriculum

Full curriculum

Arrows go from each prerequisite to the units that depend on it. Hover or focus a unit to highlight its path.

Unit content

HTMX

HTMX extends HTML with attributes that let elements issue HTTP requests and replace parts of the current document with HTML returned by the server.

The central idea is to keep HTTP and server-rendered HTML as the application interface instead of requiring every dynamic interaction to be represented as a client-side JSON API plus custom JavaScript state.

Requests from HTML

For example,

<button hx-post="/votes/42" hx-target="#score">
  Vote
</button>

can issue a POST request when the button is activated.

Attributes such as hx-get, hx-post, hx-put and hx-delete select the HTTP interaction.

Targets and swaps

hx-target chooses which element should receive the response, while hx-swap controls how returned HTML is inserted or replaces existing content.

The server can therefore return only the fragment needed for the affected region rather than a complete page.

Server remains authoritative

HTMX changes how browser interactions are initiated and applied; it does not move authorization or validation into HTML attributes. The server still interprets the request, checks permissions, changes application state and decides what response is valid.

Progressive structure

HTMX works naturally with ordinary links, forms and server-rendered templates. Interactions can often begin as standard HTML requests and later be enhanced with targeted fragment updates.

HTMX is therefore not a replacement for HTTP or HTML. It exposes more of HTTP directly through HTML so that many interactive web interfaces can remain document-oriented.