The basics: hx-preserve

09/02/2024 2 min Temporada 1 Episodio 14
The basics: hx-preserve

Listen "The basics: hx-preserve"

Episode Synopsis


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/