+++ title = "hx-swap-oob" +++ The `hx-swap-oob` attribute allows you to specify that some content in a response should be swapped into the DOM somewhere other than the target, that is "Out of Band". This allows you to piggy back updates to other element updates on a response. Consider the following response HTML: ```html
...
Saved!
``` The first div will be swapped into the target the usual manner. The second div, however, will be swapped in as a replacement for the element with the id `alerts`, and will not end up in the target. The value of the `hx-swap-oob` can be: * `true` * any valid [`hx-swap`](@/attributes/hx-swap.md) value * any valid [`hx-swap`](@/attributes/hx-swap.md) value, followed by a colon, followed by a CSS selector If the value is `true` or `outerHTML` (which are equivalent) the element will be swapped inline. If a swap value is given, that swap strategy will be used and the encapsulating tag pair will be stripped for all strategies other than `outerHTML`. If a selector is given, all elements matched by that selector will be swapped. If not, the element with an ID matching the new content will be swapped. ### Using alternate swap strategies As mentioned previously when using swap strategies other than `true` or `outerHTML` the encapsulating tags are stripped, as such you need to excapsulate the returned data with the correct tags for the context. When trying to insert a `` in a table that uses ``: ```html ... ``` A "plain" table: ```html ...
``` A `
  • ` may be encapsulated in `