Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

htmx: hx-swap='outerHtml' gets ignored

Tags:

htmx

This button should replace a <tr> but somehow "hx-swap" does replace the inner HTML, not the outer HTML:

<button hx-get="{url}" hx-target="#offer_{id}" hx-swap="outerHtml" 
        class="btn btn-secondary btn-sm">Edit</button>

See: hx-swap

like image 332
guettli Avatar asked Dec 07 '25 03:12

guettli


1 Answers

The string is case-sensitive. it works if you write outerHTML instead of "outerHtml".

like image 179
guettli Avatar answered Dec 11 '25 22:12

guettli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!