mirror of
https://github.com/bigskysoftware/htmx.git
synced 2025-09-28 05:21:18 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
193a9ea9d2
@ -24,6 +24,23 @@ This button will issue a `GET` to `/info` and then select the element with the i
|
||||
which will replace the entire button in the DOM, and, in addition, pick out an element with the id `alert`
|
||||
in the response and swap it in for div in the DOM with the same ID.
|
||||
|
||||
Each value in the comma separated list of values can specify any valid [`hx-swap`](@/attributes/hx-swap.md)
|
||||
strategy by separating the selector and the swap strategy with a `:`.
|
||||
|
||||
For example, to prepend the alert content instead of replacing it:
|
||||
|
||||
```html
|
||||
<div>
|
||||
<div id="alert"></div>
|
||||
<button hx-get="/info"
|
||||
hx-select="#info-details"
|
||||
hx-swap="outerHTML"
|
||||
hx-select-oob="#alert:afterbegin">
|
||||
Get Info!
|
||||
</button>
|
||||
</div>
|
||||
```
|
||||
|
||||
## Notes
|
||||
|
||||
* `hx-select-oob` is inherited and can be placed on a parent element
|
||||
|
Loading…
x
Reference in New Issue
Block a user