Sveriges mest populära poddar

hx-pod

The basics: hx-preserve

3 min • 9 februari 2024

Updating a chunk of the DOM is easy --  but what if you wanted to leave one element alone?

<div id="leave-me-alone" hx-preserve>Content preserved</div>

Content will NOT be swapped out in the request, as long as the id in the request data matches.

https://htmx.org/attributes/hx-preserve/

Förekommer på
00:00 -00:00