There are extensions integrating htmx with "morphing" libraries https://htmx.org/docs/#morphing, that should help you achieve the desired outcome, namely
alpine-morph
,
morphdom-swap
and brand new
idiomorph
from 1cg himself.
What's your goal though? I imagine, there isn't much elements state to keep within search results?