PLAY PODCASTS
The basics: hx-preserve
Season 1 · Episode 14

The basics: hx-preserve

hx-pod

February 9, 20242m 32s

Audio is streamed directly from the publisher (media.transistor.fm) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

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/

Topics

htmx javascript programming laravel livewire minimalism coding html simplicity