By default a swap is triggered on every htmx request. If you return html from that endpoint, it will be swapped. You said you put code on a div, but if you put it on the actual select element you don't even have to bother with
hx-target
. For example,
Copy code
html
<!-- form -->
<select hx-trigger="load" hx-get="/get/my/options"></select>
<!-- return from /get/my/options -->
<option>option 1</option>
<option>option 2</option>